update route removal to include source IP for exit node and peer management

This commit is contained in:
Owen
2026-08-07 15:50:58 -04:00
parent f4b85701aa
commit d21b7591c4
2 changed files with 3 additions and 2 deletions

View File

@@ -176,7 +176,8 @@ func (o *Olm) removeExitNodePeerLocked() error {
interfaceName := o.tunnelConfig.InterfaceName
serverIPForRoute := strings.Split(cfg.ServerIP, "/")[0] + "/32"
if err := network.RemoveRouteForServerIP(serverIPForRoute, interfaceName); err != nil {
tunnelIPForRoute := strings.Split(cfg.TunnelIP, "/")[0]
if err := network.RemoveRouteForServerIPWithSource(serverIPForRoute, interfaceName, tunnelIPForRoute); err != nil {
logger.Warn("Failed to remove route for exit node server IP: %v", err)
}

View File

@@ -285,7 +285,7 @@ func (pm *PeerManager) RemovePeer(siteId int) error {
return err
}
if err := network.RemoveRouteForServerIP(peer.ServerIP, pm.interfaceName); err != nil {
if err := network.RemoveRouteForServerIPWithSource(peer.ServerIP, pm.interfaceName, pm.localIP); err != nil {
logger.Error("Failed to remove route for server IP: %v", err)
}