]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/commitdiff
Revive route cleanup for /sbin/route code
authorGernot Hillier <gernot.hillier@siemens.com>
Wed, 21 Feb 2018 16:46:43 +0000 (17:46 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Mon, 26 Feb 2018 15:22:35 +0000 (16:22 +0100)
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.

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@siemens.com>
Tested-by: Thomas Zander <thomas.zander@siemens.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
vpnc-script

index a5f6c9c7cb04abe17714029612ae728afe9f1bd9..860add460336461df470df020a98f56d34e8fea7 100755 (executable)
@@ -357,7 +357,6 @@ else # use route command
                NETWORK="$1"
                NETMASK="$2"
                NETMASKLEN="$3"
-               del_network_route "$NETWORK" "$NETMASK" "$NETMASKLEN"
                route add -net "$NETWORK" $route_syntax_netmask "$NETMASK" $route_syntax_gw "$INTERNAL_IP4_ADDRESS" $route_syntax_interface
        }
 
@@ -392,12 +391,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"