lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] what the NETIF_FLAG_DHCP is for?


From: Kiran Bacchewar
Subject: Re: [lwip-users] what the NETIF_FLAG_DHCP is for?
Date: Sun, 29 Jun 2008 17:09:55 +0530

Thank you jonathan,

I debugged the code once again, i found that dhcp_bind() was never called. It was the problem of the driver, which was skipping the ACK from the dhcp server,as the processor was running at low speed and there where many debugging statements involved to print  ... so, it was unable to take the immediate reply from the server... 

your reply helped me a lot.... now it is working fine.

On 6/27/08, Jonathan Larmour <address@hidden> wrote:
Kiran Bacchewar wrote:
HI all,
 i want to enable the DHCP in lwip. iam using lwip 1.3 version.
 i made the fallowing initialization...
 #define LWIP_DHCP    1                (in lwipopts.h)
ip_addr.addr=0;                                (in init.c file)
netmask.addr=0; gw.addr=0;
netif_add(netif,ip_addr,netmask,gw,state,drvr_init,ethernet_input);
netif_set_default(netif);
netif_set_up(netif1);
dhcp_start(netif);

I assume that netif_add isn't literally what you have as I would have expected something like netif_add(netif, &ip_addr, &netmask, &gw, netif->state, ....).

and the netif_set_up(netif1) should not have the "1".

But I guess that's just you simplifying for here.

by this initialization, i can see the DISCOVER,OFFER,REQUEST,ACK packets sent to/from by the lwip as per the DHCP standard.... but when i ping for the offerd address, the board(on which lwip is ported)  doesn't respond...  after doing some debug... i found that there is no ip address assigned in the netif->ip_addr, its assignde to 'zero' the initial value...
 and if i disable the DHCP and give
1>the static ip addresses
2>make LWIP_DHCP  0  3>remove the dhcp_start()
 the ping, all the other appliacations works fine....
what might be the problem??? is the DHCP initialization right??? am i missing some thing???

I can't instantly see the issue. Are you using the tcpip thread?

In lwipopts.h you could enable LWIP_DEBUG and set DHCP_DEBUG to LWIP_DBG_ON to get debug output from the dhcp module to see what it thinks is going on.

Or alternatively you can debug the dhcp_recv() function in dhcp.c from your debugger, and see why it isn't calling dhcp_bind().

what is the significance of NETIF_FLAG_DHCP?? where it should be set into the netif flags in the initialization sequence???

You don't need to set it. It gets set by dhcp_start.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



--
Regards,
Kirankumar K B
M: 9373709346
reply via email to

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