Skip to content

Commit

Permalink
Allow multiple connections to the same link-local address
Browse files Browse the repository at this point in the history
Note that this may mean that currently we end up with two links to each multicast-discovered peer, one incoming and one outgoing
  • Loading branch information
neilalexander committed Jul 20, 2024
1 parent c505097 commit 8ecc402
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/core/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net"
"net/netip"
"net/url"
"strconv"
"strings"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 8ecc402

Please sign in to comment.