mirror of
https://github.com/netbirdio/go-netroute.git
synced 2026-05-22 17:11:07 -07:00
Merge pull request #17 from libp2p/fix/loopbackv6
skip loopback addr as indication of v6 routes
This commit is contained in:
+5
-1
@@ -32,7 +32,11 @@ func TestRoute(t *testing.T) {
|
||||
for _, addr := range addrs {
|
||||
if strings.HasPrefix(addr.Network(), "ip") {
|
||||
_, ipn, _ := net.ParseCIDR(addr.String())
|
||||
if ipn.IP.To4() == nil && !ipn.IP.IsInterfaceLocalMulticast() && !ipn.IP.IsLinkLocalUnicast() && !ipn.IP.IsLinkLocalMulticast() {
|
||||
if ipn.IP.To4() == nil &&
|
||||
!ipn.IP.IsLoopback() &&
|
||||
!ipn.IP.IsInterfaceLocalMulticast() &&
|
||||
!ipn.IP.IsLinkLocalUnicast() &&
|
||||
!ipn.IP.IsLinkLocalMulticast() {
|
||||
hasV6 = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user