]> git.ipfire.org Git - network.git/commitdiff
ppp: Make sure that the routing tables are up to date.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Jun 2012 11:23:16 +0000 (11:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Jun 2012 11:23:16 +0000 (11:23 +0000)
functions.ppp
functions.routing

index 38a8d64dfe6b7e8ce46c465436c7c6134483317d..dc5990ea0f07df5c49c228144b2f591c5ece2e7c 100644 (file)
@@ -98,6 +98,7 @@ function ppp_common_ip_up() {
 
        routing_db_set ${zone} ipv4 active 1
        routing_update ${zone} ipv4
+       routing_default_update
 
        # Emit interface-up event
        event_interface_up ${zone}
@@ -118,6 +119,7 @@ function ppp_common_ip_down() {
        # and update the routing table.
        routing_db_remove ${zone} ipv4
        routing_update ${zone} ipv4
+       routing_default_update
 
        # Save accounting information
        ppp_accounting ${zone}
@@ -142,6 +144,7 @@ function ppp_common_ipv6_up() {
 
        routing_db_set ${zone} ipv6 active 1
        routing_update ${zone} ipv6
+       routing_default_update
 
        # Emit interface-up event
        event_interface_up ${zone}
@@ -162,6 +165,7 @@ function ppp_common_ipv6_down() {
        # and update the routing table.
        routing_db_remove ${zone} ipv6
        routing_update ${zone} ipv6
+       routing_default_update
 
        # Save accounting information
        ppp_accounting ${zone}
index 111f7baf58a509de3319817c097e802ae4a108b1..10e12828ee8ede8a5a97ecf37fa904eaf86b05e0 100644 (file)
@@ -223,6 +223,11 @@ function routing_update() {
        log DEBUG "Flushing routing table ${table}"
        cmd ${ip_cmd} route flush table ${table}
 
+       # Exit here if there is no routing information.
+       if ! routing_db_exists ${zone} ${proto}; then
+               return ${EXIT_OK}
+       fi
+
        local local_ip_address=$(routing_db_get ${zone} ${proto} local-ip-address)
        local remote_ip_address=$(routing_db_get ${zone} ${proto} remote-ip-address)