]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.routing
vlan: Check if parent device exists before bringing it up
[people/ms/network.git] / src / functions / functions.routing
index 707e0268dea4a56f2483bef49e8ce75de051e317..351cc53b756590eb29d9895fd5f5c1093b7db736 100644 (file)
@@ -80,6 +80,9 @@ routing_default_update() {
                # Remove too much spaces.
                routes=$(echo ${routes})
 
+               # Reload bird configuration
+               [[ "${proto}" = "ipv6" ]] && bird_update
+
                # Remove all default routes.
                if [ -z "${routes}" ]; then
                        cmd ${cmd} del default
@@ -92,13 +95,6 @@ routing_default_update() {
                cmd ${cmd} replace default ${routes}
                assert [ $? -eq 0 ]
 
-               case "${proto}" in
-                       ipv6)
-                               # Apply radvd configuration.
-                               radvd_update
-                               ;;
-               esac
-
                triggers_execute_all "online"
        done
 }
@@ -168,10 +164,10 @@ routing_update() {
 
        case "${proto}" in
                ipv4)
-                       local net_address=$(ipv4_get_netaddress ${local_ip_address})
+                       local network=$(ipv4_get_network "${local_ip_address}")
 
                        log DEBUG "Adding route for subnet ${local_ip_address} to table ${table}"
-                       cmd ${ip_cmd} route add table ${table} ${net_address} dev ${zone}
+                       cmd ${ip_cmd} route add table "${table}" "${network}" dev "${zone}"
                        ;;
        esac