From: Michael Tremer Date: Fri, 22 Jun 2012 11:23:16 +0000 (+0000) Subject: ppp: Make sure that the routing tables are up to date. X-Git-Tag: 004~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5a771cfcf643bdea203b7d6baf1b1ddb8759def;p=network.git ppp: Make sure that the routing tables are up to date. --- diff --git a/functions.ppp b/functions.ppp index 38a8d64d..dc5990ea 100644 --- a/functions.ppp +++ b/functions.ppp @@ -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} diff --git a/functions.routing b/functions.routing index 111f7baf..10e12828 100644 --- a/functions.routing +++ b/functions.routing @@ -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)