test windows

This commit is contained in:
Pascal Fischer 2023-06-12 12:16:00 +02:00
parent ce091ab42b
commit a5d14c92ff

View File

@ -4,6 +4,7 @@
package routemanager package routemanager
import ( import (
"fmt"
"net" "net"
"net/netip" "net/netip"
@ -29,6 +30,8 @@ func existsInRouteTable(prefix netip.Prefix) (bool, error) {
ip := net.ParseIP(route.Mask) ip := net.ParseIP(route.Mask)
mask := net.IPMask(ip) mask := net.IPMask(ip)
cidr, _ := mask.Size() cidr, _ := mask.Size()
fmt.Println(route.Destination, "<=>", prefix.Addr().String())
fmt.Println(cidr, "<=>", prefix.Bits())
if route.Destination == prefix.Addr().String() && cidr == prefix.Bits() { if route.Destination == prefix.Addr().String() && cidr == prefix.Bits() {
return true, nil return true, nil
} }