From 9a68f7485737bd202679842a321866032172a63e Mon Sep 17 00:00:00 2001 From: christiaans Date: Thu, 30 Nov 2006 16:25:43 +0000 Subject: [PATCH] Fixed false triggers of request_timeout. --- CHANGELOG | 3 +++ src/core/dhcp.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a1ede80e..160382c0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -62,6 +62,9 @@ HISTORY optional LWIP_PLATFORM_HTONS(), LWIP_PLATFORM_HTONL() macros. ++ Bug fixes: + + 2006-11-30 Christiaan Simons + * dhcp.c: Fixed false triggers of request_timeout. 2006-11-28 Christiaan Simons * netif.c: In netif_add() fixed missing clear of ip_addr, netmask, gw and flags. diff --git a/src/core/dhcp.c b/src/core/dhcp.c index b5d46eef..8368d523 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -310,8 +310,12 @@ void dhcp_fine_tmr() while (netif != NULL) { /* only act on DHCP configured interfaces */ if (netif->dhcp != NULL) { - /* timer is active (non zero), and is about to trigger now */ - if (netif->dhcp->request_timeout-- == 1) { + /* timer is active (non zero), and is about to trigger now */ + if (netif->dhcp->request_timeout > 1) { + netif->dhcp->request_timeout--; + } + else if (netif->dhcp->request_timeout == 1) { + netif->dhcp->request_timeout--; /* { netif->dhcp->request_timeout == 0 } */ LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_fine_tmr(): request timeout\n")); /* this clients' request timeout triggered */