lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How to securely switch between DHCP and static IP assig


From: address@hidden
Subject: Re: [lwip-users] How to securely switch between DHCP and static IP assignment?
Date: Thu, 22 Jul 2010 21:41:31 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1

First of all, it always helps to know which version you are using (so I know which files I have to search in).
Then, since you are using an OS, are you calling the below functions from tcpip_thread or from another thread (or interrupt context)? You may only call them from tcpip_thread since they are accessing raw api functions!

Benjamin Schelte wrote:

[..]

So the problem occurs after calling the function iEthCtrl_UseDHCP().

After doing so it sometimes happens to stop executing on an assert in dhcp_create_request().

Assert:

LWIP_ASSERT("dhcp_create_request: dhcp->p_out == NULL", dhcp->p_out == NULL);

 

Callstack:

dhcp_create_request

dhcp_select

dhcp_handle_offer

dhcp_recv

udp_input

ip_input

ethernet_input

tcpip_thread

 

 

So my questions are the following.

Why is a DHCP-request forwarded to the DHCP-handler, although dhcp_stop() has been called before?


Ehrm, above you said it happened after calling xxx_UseDHCP(), which calls dhcp_start(), so I guess it's correct that the DHCP handler is called, isn't it?
As to the assert, from looking at the code (of lwIP version 1.3.2), I can't tell what's going wrong, the assert shouldn't happen with the callstack you provided... Aside from that, your code seems to look OK, but I didn't have the time to actually check it.

Simon

reply via email to

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