summaryrefslogtreecommitdiffstats
path: root/src/net/udp
diff options
context:
space:
mode:
authorMichael Brown2015-10-30 14:18:51 +0100
committerMichael Brown2015-10-30 14:29:03 +0100
commit7cc7e0ec86f3ce701a3b829f54b49eab235e43d7 (patch)
tree0bfb657bee7a74c957cfe7f620bb0a3657fcb613 /src/net/udp
parent[efi] Add support for EFI_GRAPHICS_OUTPUT_PROTOCOL frame buffer consoles (diff)
downloadipxe-7cc7e0ec86f3ce701a3b829f54b49eab235e43d7.tar.gz
ipxe-7cc7e0ec86f3ce701a3b829f54b49eab235e43d7.tar.xz
ipxe-7cc7e0ec86f3ce701a3b829f54b49eab235e43d7.zip
[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>
Diffstat (limited to 'src/net/udp')
-rw-r--r--src/net/udp/dhcp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c
index 36c2b13a..9c7b2fdc 100644
--- a/src/net/udp/dhcp.c
+++ b/src/net/udp/dhcp.c
@@ -446,6 +446,7 @@ static void dhcp_discovery_expired ( struct dhcp_session *dhcp ) {
/* If link is blocked, defer DHCP discovery (and reset timeout) */
if ( netdev_link_blocked ( dhcp->netdev ) ) {
DBGC ( dhcp, "DHCP %p deferring discovery\n", dhcp );
+ dhcp->start = currticks();
start_timer_fixed ( &dhcp->timer,
( DHCP_DISC_START_TIMEOUT_SEC *
TICKS_PER_SEC ) );