mirror of
https://github.com/netbirdio/netbird.git
synced 2025-04-02 20:36:25 +02:00
test windows
This commit is contained in:
parent
d2fad1cfd9
commit
ce091ab42b
@ -4,7 +4,7 @@
|
|||||||
package routemanager
|
package routemanager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
|
||||||
"github.com/yusufpapurcu/wmi"
|
"github.com/yusufpapurcu/wmi"
|
||||||
@ -25,15 +25,13 @@ func existsInRouteTable(prefix netip.Prefix) (bool, error) {
|
|||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Destination Networks:")
|
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
fmt.Println("Destination :", route.Destination)
|
ip := net.ParseIP(route.Mask)
|
||||||
fmt.Println("Mask :", route.Mask)
|
mask := net.IPMask(ip)
|
||||||
// mask, _ := toIPAddr(m.Addrs[2])
|
cidr, _ := mask.Size()
|
||||||
// cidr, _ := net.IPMask(mask.To4()).Size()
|
if route.Destination == prefix.Addr().String() && cidr == prefix.Bits() {
|
||||||
// if route.Destination == prefix.Addr().String() && cidr == prefix.Bits() {
|
return true, nil
|
||||||
// return true, nil
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user