]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/dhclient-script
wireless-ap: Add support for WPA3 and rewrite WPA2
[people/ms/network.git] / src / dhclient-script
index 73dfbfaa9ccf1dea5925af2ccae4b3f98ed90057..ec990bf1a9bfb4c4fafe0bb750940427be0d4b9f 100644 (file)
@@ -168,14 +168,8 @@ case "${reason}" in
                        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
@@ -203,27 +197,27 @@ case "${reason}" in
 
        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_calculate_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.