silenced logs

This commit is contained in:
0xdcarns
2022-02-05 15:00:26 -05:00
parent 25ea986402
commit 3713d1891a
6 changed files with 57 additions and 24 deletions

View File

@@ -58,7 +58,21 @@ func SetCurrentPeerRoutes(iface, currentAddr string, peers []wgtypes.Peer) {
}
}
// FlushPeerRoutes - removes all current peer routes
func FlushPeerRoutes(iface, currentAddr string, peers []wgtypes.Peer) {
for _, peer := range peers {
for _, allowedIP := range peer.AllowedIPs {
deleteRoute(iface, &allowedIP, currentAddr)
}
}
}
// SetCIDRRoute - sets the CIDR route, used on join and restarts
func SetCIDRRoute(iface, currentAddr string, cidr *net.IPNet) {
setCidr(iface, currentAddr, cidr)
}
// RemoveCIDRRoute - removes a static cidr route
func RemoveCIDRRoute(iface, currentAddr string, cidr *net.IPNet) {
removeCidr(iface, cidr, currentAddr)
}