Skip to content

Commit 34752ac

Browse files
authored
Merge pull request #17 from libp2p/fix/loopbackv6
skip loopback addr as indication of v6 routes
2 parents 68596b5 + 7079654 commit 34752ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

netroute_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ func TestRoute(t *testing.T) {
3232
for _, addr := range addrs {
3333
if strings.HasPrefix(addr.Network(), "ip") {
3434
_, ipn, _ := net.ParseCIDR(addr.String())
35-
if ipn.IP.To4() == nil && !ipn.IP.IsInterfaceLocalMulticast() && !ipn.IP.IsLinkLocalUnicast() && !ipn.IP.IsLinkLocalMulticast() {
35+
if ipn.IP.To4() == nil &&
36+
!ipn.IP.IsLoopback() &&
37+
!ipn.IP.IsInterfaceLocalMulticast() &&
38+
!ipn.IP.IsLinkLocalUnicast() &&
39+
!ipn.IP.IsLinkLocalMulticast() {
3640
hasV6 = true
3741
break
3842
}

0 commit comments

Comments
 (0)