changeset 2261:7647be917379 draft

Force renew now works when we are in the informed state.
author Roy Marples <roy@marples.name>
date Fri, 31 Jan 2014 12:41:30 +0000
parents 8b82f0165b96
children 8c06c98f7b92
files dhcp.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp.c	Fri Jan 31 12:26:39 2014 +0000
+++ b/dhcp.c	Fri Jan 31 12:41:30 2014 +0000
@@ -2182,7 +2182,7 @@
 			    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 @@
 		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;
 	}