]> git.ipfire.org Git - network.git/commitdiff
Fix routing for ipv6-static hook.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Jun 2011 21:42:27 +0000 (21:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Jun 2011 21:42:27 +0000 (21:42 +0000)
hooks/zones/bridge.configs/ipv6-static

index d814fe73650c55792b16760e2807ec3587993045..aaaafacd5b49b3b8f1df77d5565cc7443732b8e4 100755 (executable)
@@ -78,8 +78,11 @@ function _up() {
 
        ip_address_add ${zone} ${ADDRESS}/${PREFIX}
 
-       if zone_is_nonlocal ${zone} && [ -n "${GATEWAY}" ]; then
-               : # XXX to be done
+       if [ -n "${GATEWAY}" ]; then
+               routing_db_set ${zone} ipv6 local-ip-address ${ADDRESS}/${PREFIX}
+               routing_db_set ${zone} ipv6 remote-ip-address ${GATEWAY}
+               routing_db_set ${zone} ipv6 active 1
+               routing_default_update
        fi
 
        exit ${EXIT_OK}
@@ -94,11 +97,17 @@ function _down() {
                error "Zone '${zone}' doesn't exist."
                exit ${EXIT_ERROR}
        fi
+
+       # Remove routing information from database.
+       routing_db_remove ${zone} ipv6
        
        config_read $(zone_dir ${zone})/configs/${config}
 
        ip_address_del ${zone} ${ADDRESS}/${PREFIX}
 
+       # Update routing tables.
+       routing_default_update
+
        exit ${EXIT_OK}
 }