# 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
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
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_interface_mtu}" = "${new_interface_mtu}" ]; 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