From: Jonatan Schlag Date: Fri, 2 Jun 2017 06:30:35 +0000 (+0200) Subject: route: apply static routes on startup and restart X-Git-Tag: 009~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7470f3977ab2c4a5279c00a26c41a8df8263366a;p=network.git route: apply static routes on startup and restart The static routes can only be applied when the network has a valid layer 3 connectivity. So it is not useful to have a route_init which is called before we have any layer 3 connectivity. We now call the route_apply every time we set new routes for a zone. We do this every time we get a new layer 3 connectivity so all routes are applied correctly. Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.route b/src/functions/functions.route index 8fc44d5d..1b6369ef 100644 --- a/src/functions/functions.route +++ b/src/functions/functions.route @@ -22,13 +22,6 @@ # Functions for static routing. # -route_init() { - # Apply configured static routes. - route_apply -} - -init_register route_init - route_add() { local ${NETWORK_CONFIG_ROUTES_PARAMS} diff --git a/src/functions/functions.routing b/src/functions/functions.routing index c7aac094..24365856 100644 --- a/src/functions/functions.routing +++ b/src/functions/functions.routing @@ -181,4 +181,7 @@ routing_update() { cmd ${routing_cmd} cmd ${ip_cmd} rule add from ${local_ip_address} lookup ${table} + + # Apply all static routes + route_apply }