From 8ecc402d7c48da048cf700f5c6028737a14abfad Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 20 Jul 2024 11:31:08 +0100 Subject: [PATCH] Allow multiple connections to the same link-local address Note that this may mean that currently we end up with two links to each multicast-discovered peer, one incoming and one outgoing --- src/core/link.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/core/link.go b/src/core/link.go index 6bcbec5..fb78004 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "net" - "net/netip" "net/url" "strconv" "strings" @@ -641,16 +640,6 @@ func (l *links) handler(linkType linkType, options linkOptions, conn net.Conn, s func urlForLinkInfo(u url.URL) url.URL { u.RawQuery = "" - if host, _, err := net.SplitHostPort(u.Host); err == nil { - if addr, err := netip.ParseAddr(host); err == nil { - // For peers that look like multicast peers (i.e. - // link-local addresses), we will ignore the port number, - // otherwise we might open multiple connections to them. - if addr.IsLinkLocalUnicast() { - u.Host = fmt.Sprintf("[%s]", addr.String()) - } - } - } return u }