]> git.ipfire.org Git - people/ms/network.git/commitdiff
route: apply static routes on startup and restart
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Fri, 2 Jun 2017 06:30:35 +0000 (08:30 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jun 2017 07:57:03 +0000 (08:57 +0100)
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 <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.route
src/functions/functions.routing

index 8fc44d5d0adf151c417a7e248811d75721e36fba..1b6369efbbee15466481b6684ee49221753d247f 100644 (file)
 # Functions for static routing.
 #
 
-route_init() {
-       # Apply configured static routes.
-       route_apply
-}
-
-init_register route_init
-
 route_add() {
        local ${NETWORK_CONFIG_ROUTES_PARAMS}
 
index c7aac094f11cdca2c4d88abc8a65df4816666425..24365856f155fbc82b6780891a9fd0d1c79ae4f7 100644 (file)
@@ -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
 }