[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #19927] DHCP NACK problem
From: |
Cui hengbin |
Subject: |
[lwip-devel] [bug #19927] DHCP NACK problem |
Date: |
Tue, 22 May 2007 07:08:34 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 |
URL:
<http://savannah.nongnu.org/bugs/?19927>
Summary: DHCP NACK problem
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: phant
Submitted on: Tuesday 05/22/2007 at 07:08
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Hi All:
I use dhcp in my project with a CableModem.when starting the TCP/IP ,CM
give me a ip address through DHCP,But when CM is on line ,CM send NACK to
me,so I must discover again .But In dhcp_hanfrl_nak() simple set state with
DHCP_BACKING_OFF,let dhcp_timeout to discover,when sniffering the network,I
find discover UDP broadcast with the old IP adress .is not "0.0.0.0",so dhcp
server may not reply.
so I change the dhcp_timeout follow:
static void dhcp_timeout(struct netif *netif)
{
struct dhcp *dhcp = netif->dhcp;
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_timeout()\n"));
/* back-off period has passed, or server selection timed out */
if (dhcp->state == DHCP_BACKING_OFF) {
dhcp_release(netif);
dhcp_discover(netif);
}else if(dhcp->state == DHCP_SELECTING) {
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting
discovery\n"));
dhcp_discover(netif);
/* receiving the requested lease timed out */
} else if (dhcp->state == DHCP_REQUESTING) {
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("dhcp_timeout(): REQUESTING, DHCP request timed out\n"));
if (dhcp->tries <= 5) {
dhcp_select(netif);
} else {
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("dhcp_timeout(): REQUESTING, releasing, restarting\n"));
dhcp_release(netif);
dhcp_discover(netif);
}
/* received no ARP reply for the offered address (which is good) */
}.........
.........
}
Can You agree?
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?19927>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #19927] DHCP NACK problem,
Cui hengbin <=