# Flush all other aborted IP addresses
ipv6_address_flush "${interface}"
+ # Disable autoconf because DHCP is handling this
+ ipv6_device_autoconf_disable "${interface}"
+
+ # Enable forwarding because we are acting as a host
+ # to uplink network zones.
+ ipv6_device_forwarding_enable "${interface}" --accept-ra
+
# Wait until DAD for the link-local address has finished
for address in $(ipv6_device_get_addresses "${interface}" --scope="link"); do
ipv6_wait_for_dad "${address}" "${interface}" && exit ${EXIT_OK}
db_set "${interface}/ipv6/active" 1
#db_set "${interface}/ipv6/domain-name" "${new_
+ # Update the routing tables
+ routing_update "${interface}" ipv6
+
exit 0
# Handle Prefix Delegation
ipv6_address_add "${new_ip6_address}/${new_ip6_prefixlen}" "${interface}" \
--valid-lifetime="${new_max_life}" --preferred-lifetime="${new_preferred_life}"
+ # Update the routing tables
+ routing_update "${interface}" ipv6
+
exit ${EXIT_OK}
# Handle Prefix Delegation
--preferred-lifetime=0 || exit ${EXIT_ERROR}
;;
+ EXPIRE6|FAIL6|RELEASE6|STOP6)
+ # Remove the currently configured addresses from the device.
+ ipv6_address_flush "${interface}"
+
+ # Reset autoconf mode and disable forwarding
+ ipv6_device_forwarding_disable "${interface}"
+ ipv6_device_autoconf_disable "${interface}"
+
+ db_delete "${interface}/ipv6"
+
+ exit 0
+ ;;
+
# IPv4
PREINIT)
ipv6_device_forwarding_enable() {
local device="${1}"
+ shift
+
+ local accept_ra=0
+
+ local arg
+ while read arg; do
+ case "${arg}" in
+ --accept-ra)
+ accept_ra=2
+ ;;
+ esac
+ done <<< "$(args $@)"
sysctl_set "net.ipv6.conf.${device}.forwarding" 1
log INFO "Enabled IPv6 forwarding on '${device}'"
+
+ # If forwarding is enabled, the kernel won't process
+ # any router advertisements any more, which is not good
+ # when we still want a default route when running in
+ # DHCP client mode on an uplink zone.
+ if [ ${accept_ra} -gt 0 ]; then
+ log INFO " and accepting router advertisements"
+
+ sysctl_set "net.ipv6.conf.${device}.accept_ra" 2
+ fi
}
ipv6_device_forwarding_disable() {
# Remove any stale addresses from aborted clients
cmd_quiet ip -6 addr flush dev "${device}" scope global permanent
+ cmd_quiet ip -6 addr flush dev "${device}" scope global dynamic
}
ipv6_address_change_lifetime() {