mirror of
https://github.com/fosrl/olm.git
synced 2026-08-31 03:01:29 +02:00
update route removal to include source IP for exit node and peer management
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user