lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] lwIP 1.4.1 DHCP problem


From: Mikael Ponten
Subject: [lwip-users] lwIP 1.4.1 DHCP problem
Date: Mon, 18 Mar 2013 15:53:12 +0100

Hello everyone,
 
I am using lwIP for the first time and get problems when DHCP is enabled. My setup is two PCs running Windows and a board containing a microcontroller and the ENC28J60 Ethernet controller. All 3 units are connected to a Netgear broadband router, which acts as DHCP server. The board has an RTOS and there are many threads running, one of them being the lwip manager. This manager fetches pointers to command buffers from a queue and acts upon these commands by calling lwIP timer functions or by calling the recommended input function when a frame has been received (delivered in a pre-allocated pbuf). I have NO_SYS==1 and all calls to lwIP are handled in the context of the lwIP manager, using the raw API.
 
When I have the system configured for static IP addresses, ping works when issued from the command prompt on one of the PCs. However, when the system is rebuilt with DHCP enabled, it just sends DHCP requests over and over again until the dawn of universe as it seems. That is the problem. The PCs don't have a problem with DHCP. When I look at Attached Devices in the router, it displays only the two PCs. In struct netif I can see that netif.flags = 7B, which means that it has bit NETIF_FLAG_DHCP set, but netif fields ip_addr, netmask and gw are still clear.
 
I have enabled debug printouts and what comes out seems ok to me, maybe except for those related to DHCP. There is also a simple sniffer running on the target and when it is active it receives copies of incoming and outgoing packets in a separate queue. The sniffer is running at lower priority than the lwIP manager, so that is why the printouts from lwIP appear before those of the sniffer.
 
I would be very grateful if someone familiar with lwIP and DHCP would be kind to take a look at the attached printout. There is a statistics output at the end. There doesn't seem to be a DHCP offer after lwIP has output the DHCP request, so my question is: is there a problem with that frame or the initial ARP frame that lwIP outputs when started? Is it ok to first issue an ARP request and then immediately a DHCP request?
 
Best regards
Mike
 

Attachment: ZOC130318.LOG
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]