[dhcp] Reset start time when deferring discovery
authorMichael Brown <mcb30@ipxe.org>
Fri, 30 Oct 2015 13:18:51 +0000 (13:18 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 30 Oct 2015 13:29:03 +0000 (13:29 +0000)
commit7cc7e0ec86f3ce701a3b829f54b49eab235e43d7
tree0bfb657bee7a74c957cfe7f620bb0a3657fcb613
parent6847232e70f7fbff2f5637505a85532ec752a11f
[dhcp] Reset start time when deferring discovery

If we detect (via STP) that a switch port is in a non-forwarding
state, then the link is marked as being temporarily blocked and DHCP
discovery will be deferred until the link becomes unblocked.

The timer used to decide when to give up waiting for ProxyDHCPOFFERs
is currently based on the time that DHCP discovery was started, and
makes no allowances for any time spent waiting for the link to become
unblocked.  Consequently, if STP is used then the timeout for
ProxyDHCPOFFERs becomes essentially zero.

Fix by resetting the recorded start time whenever DHCP discovery is
deferred due to a blocked link.

Debugged-by: Sebastian Roth <sebastian.roth@zoho.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/udp/dhcp.c