瀏覽代碼

[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>
tags/v1.20.1
Michael Brown 9 年之前
父節點
當前提交
7cc7e0ec86
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. 1
    0
      src/net/udp/dhcp.c

+ 1
- 0
src/net/udp/dhcp.c 查看文件

@@ -446,6 +446,7 @@ static void dhcp_discovery_expired ( struct dhcp_session *dhcp ) {
446 446
 	/* If link is blocked, defer DHCP discovery (and reset timeout) */
447 447
 	if ( netdev_link_blocked ( dhcp->netdev ) ) {
448 448
 		DBGC ( dhcp, "DHCP %p deferring discovery\n", dhcp );
449
+		dhcp->start = currticks();
449 450
 		start_timer_fixed ( &dhcp->timer,
450 451
 				    ( DHCP_DISC_START_TIMEOUT_SEC *
451 452
 				      TICKS_PER_SEC ) );

Loading…
取消
儲存