# 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
# Update nameservers if those have changed
if [[ "${old_dhcp6_name_servers}" != "${new_dhcp6_name_servers}" ]]; then
db_set "${interface}/ipv6/domain-name-servers" "${new_dhcp6_name_servers}"
- dns_generate_resolvconf
+ dns_server_update
fi
# Update the lifetime if the address has not changed
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)
zone_up ${interface}
fi
- # If the use configured a delay, we will honour that.
- if [ -n "${DELAY}" ]; then
- assert isinteger DELAY
- sleep ${DELAY}
-
- # If he didn't, we will try to detect is STP has brought the
- # bridge up.
- elif device_is_bridge ${interface}; then
+ # We will try to detect is STP has brought the bridge up
+ if device_is_bridge ${interface}; then
counter=60
while [ ${counter} -gt 0 ]; do
BOUND|RENEW|REBIND|REBOOT)
# Check if the IP address has changed. If so, delete all routes and stuff.
- if [ -n "${old_ip_address}" -a "${old_ip_address}" != "${new_ip_address}" ]; then
+ if [ -n "${old_ip_address}" -a "${old_ip_address}" != "${new_ip_address}" ] || \
+ [ "${reason}" = "BOUND" ]; then
ipv4_flush_device ${interface}
fi
case "${reason}" in
- BOUND|REBOOT)
+ BOUND|REBIND|REBOOT)
if [ ! "${old_ip_address}" = "${new_ip_address}" ] || \
[ ! "${old_subnet_mask}" = "${new_subnet_mask}" ] || \
[ ! "${old_network_number}" = "${new_network_number}" ] || \
[ ! "${old_broadcast_address}" = "${new_broadcast_address}" ] || \
[ ! "${old_routers}" = "${new_routers}" ] || \
- [ ! "${old_interface_mtu}" = "${new_interface_mtu}" ]; then
+ [ ! "${old_interface_mtu}" = "${new_interface_mtu}" ] || \
+ [ "${reason}" = "BOUND" ]; then
- # Calc a prefix out of address and subnet mask.
- new_prefix="$(ipv4_get_prefix ${new_ip_address} ${new_subnet_mask})"
+ # Calc the prefix from the subnet mask
+ new_prefix="$(ipv4_netmask2prefix "${new_subnet_mask}")"
# Set the new ip address.
- ip_address_add ${interface} ${new_ip_address}/${new_prefix}
- device_set_up ${interface}
-
+ ip_address_add "${interface}" "${new_ip_address}/${new_prefix}"
# A MTU of 576 is used for X.25 and dialup connections. Some broken DHCP
# servers send out an MTU of 576 bytes, which will be ignored.
routing_update ${interface} ipv4
routing_default_update
- # Update resolv.conf
- dns_generate_resolvconf
+ # Update DNS configuration
+ dns_server_update
fi
;;
esac