]> git.ipfire.org Git - people/ms/network.git/commitdiff
dhclient-script: fix bound
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Mon, 28 Aug 2017 13:27:12 +0000 (15:27 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Jan 2018 13:07:26 +0000 (13:07 +0000)
When we get a BOUND we should have only new_* variables set.
So it is stated in the manpage.
Apparently, also old_* variables are set so we never got into the block where the IP address was set.
We now always set a new IP Address when we get a BOUND.

Fixes: #11363
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Jonatan Schlag &lt;<a href="mailto:jonatan.schlag@ipfire.org">jonatan.schlag@ipfire.org</a>&gt;
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dhclient-script

index c2e0678b582836cb3e8ff1eef0229835d6fabd17..ec990bf1a9bfb4c4fafe0bb750940427be0d4b9f 100644 (file)
@@ -197,7 +197,8 @@ 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
 
@@ -208,7 +209,8 @@ case "${reason}" in
                                        [ ! "${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 the prefix from the subnet mask