]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Force renew now works when we are in the informed state.
authorRoy Marples <roy@marples.name>
Fri, 31 Jan 2014 12:41:30 +0000 (12:41 +0000)
committerRoy Marples <roy@marples.name>
Fri, 31 Jan 2014 12:41:30 +0000 (12:41 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 59f475e720797fd3d0b4e1fae444fe03a9a4f3eb..3eecb24295f43f02ad1614b5a4a5ac0cee477f48 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2182,7 +2182,7 @@ dhcp_handledhcp(struct interface *iface, struct dhcp_message **dhcpp,
                            iface, dhcp, from);
                        return;
                }
-               if (state->state != DHS_BOUND) {
+               if (state->state != DHS_BOUND && state->state != DHS_INFORM) {
                        log_dhcp(LOG_DEBUG, "not bound, ignoring Force Renew",
                            iface, dhcp, from);
                        return;
@@ -2190,8 +2190,13 @@ dhcp_handledhcp(struct interface *iface, struct dhcp_message **dhcpp,
                log_dhcp(LOG_ERR, "Force Renew from", iface, dhcp, from);
                /* The rebind and expire timings are still the same, we just
                 * enter the renew state early */
-               eloop_timeout_delete(dhcp_renew, iface);
-               dhcp_renew(iface);
+               if (state->state == DHS_BOUND) {
+                       eloop_timeout_delete(dhcp_renew, iface);
+                       dhcp_renew(iface);
+               } else {
+                       eloop_timeout_delete(send_inform, iface);
+                       dhcp_inform(iface);
+               }
                return;
        }