[PATCH 4/4] Revive route cleanup for /sbin/route code
Gernot Hillier
gernot.hillier at siemens.com
Wed Oct 11 13:40:02 PDT 2017
Cleanup our routes upon disconnect also when using /sbin/route command - even
if OS will do it for us when TUNDEV gets removed. That's the same what the
ip-route code already does. This allows us to also cleanup rules for other
devices, as a preparation for implementing split-exclude rules.
Additionally, we obviously didn't need route deletion in set_network_route for
/sbin/route mode - this function didn't do anything until now. So remove this
call -- it's a bad idea to call del_network_route inside set_network_route
anyways because both modify the same global variables.
Signed-off-by: Gernot Hillier <gernot.hillier at siemens.com>
---
vpnc-script | 7 -------
1 file changed, 7 deletions(-)
diff --git a/vpnc-script b/vpnc-script
index 50ce252..f0503ff 100755
--- a/vpnc-script
+++ b/vpnc-script
@@ -370,7 +370,6 @@ else # use route command
else
NETGW="$INTERNAL_IP4_ADDRESS"
fi
- del_network_route "$NETWORK" "$NETMASK" "$NETMASKLEN"
route add -net "$NETWORK" $route_syntax_netmask "$NETMASK" $route_syntax_gw "$NETGW" $route_syntax_interface
}
@@ -383,12 +382,6 @@ else # use route command
}
del_network_route() {
- case "$OS" in
- Linux|NetBSD|OpenBSD|Darwin|SunOS) # and probably others...
- # routes are deleted automatically on device shutdown
- return
- ;;
- esac
NETWORK="$1"
NETMASK="$2"
NETMASKLEN="$3"
--
2.12.3
More information about the openconnect-devel
mailing list