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>
# Functions for static routing.
#
-route_init() {
- # Apply configured static routes.
- route_apply
-}
-
-init_register route_init
-
route_add() {
local ${NETWORK_CONFIG_ROUTES_PARAMS}
cmd ${routing_cmd}
cmd ${ip_cmd} rule add from ${local_ip_address} lookup ${table}
+
+ # Apply all static routes
+ route_apply
}