From 7470f3977ab2c4a5279c00a26c41a8df8263366a Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Fri, 2 Jun 2017 08:30:35 +0200 Subject: [PATCH] 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 --- src/functions/functions.route | 7 ------- src/functions/functions.routing | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) 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 } -- 2.47.3