lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] DHCP - getting address works but not responding


From: Spies, Dominik
Subject: RE: [lwip-users] DHCP - getting address works but not responding
Date: Tue, 15 May 2007 08:45:31 +0200

Hi!

The procedure you are describing should happen in dhcp_bind, called by
dhcp_timeout.
This works for my case, but after that there is some problem.

When I'm not using DHCP I set the addresses, gateway where I with DHCP
set the 0 addresses.
But at the end instaed of dhcp_start I call netif_set_up (because
dhcp_bind does that).

After that the IP-address in the netif structure is set correctly and
the device anserwers on ARP-Requests (that was another mistake hat I
fixed already). When i ping the device, this pakcet is reciedved
correctly and with some debugging i found out that the reply should have
been sent correctly (ip_output_if() returns with ERR_ok in icmp_input())
but i don't recieve an answer on the PC, the sniffer shows no answer.
But abpout every 20. packet is answerd - strange behaviour..

So when I again replace dhcp_start with netif_set_up and set "real"
(same as i would get with DHCP) address, ping works perfectly.. *argh*

Hm - my version? lwIP was in a preconfigured projetct that came with
FreeRTOS (MCB2300FreeRTOSlwIP from Yahoo groups), where can I find a
version string or something to determine the version?

Regards

Dominik

-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of Pettinato, Jim
Sent: Montag, 14. Mai 2007 21:14
To: Mailing list for lwIP users
Subject: RE: [lwip-users] DHCP - getting address works but not
responding


Okay, now I'm confused also... I took a look through the DHCP code and
it appears that all it does is set up the dhcp member sub-structure in
the netif... so what is supposed to update the netif's actual address
and gateway variables??? And where should it be done if it isn't already
handled somewhere?? I would have expected (since we're passing the netif
to the DHCP code) that once the negotiation was successful that the
offered address would be set in the netif... but I can't find that
happening anywhere?? Obviously I'm missing something...


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Pettinato, Jim
Sent: Monday, May 14, 2007 1:37 PM
To: Mailing list for lwIP users
Subject: RE: [lwip-users] DHCP - getting address works but not
responding



First of all, apologies for not changing the subject line on my previous
message which is unrelated to this thread (but I was being lazy and just
replied to populate the 'To' address).


To take a stab at your problem... I assume you've already added your
interfaces to the stack's list prior to DHCP negotiation? And if you're
using DHCP, you are allowing the DHCP code to set the interface 'up' (so
you shouldn't be doing it explicitly?)

I'm assuming you are using lwIP 1.2.0...


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Spies, Dominik
Sent: Monday, May 14, 2007 11:02 AM
To: address@hidden
Subject: [lwip-users] DHCP - getting address works but not responding


Hi!

I use a LPC2368 with FreeRTOS. I set up lwIP this way:

stats_init();
sys_init();
mem_init();
memp_init();
pbuf_init();
etharp_init();
ip_init();
udp_init();
tcp_init(); 
IP4_ADDR(&my_ipaddr_data,  0, 0, 0, 0); IP4_ADDR(&my_netmask_data, 0, 0,
0, 0); IP4_ADDR(&my_gw_data, 0, 0, 0, 0); 
netif_eth0->flags &= NETIF_FLAG_DHCP;
netif_add(netif_eth0, &my_ipaddr_data, &my_netmask_data, &my_gw_data,
NULL, ethernetif_init, ip_input); netif_set_default(netif_eth0);
dhcp_start(netif_eth0);

After that the task goes in a loop which calls the 2 dhcp functions all
500ms and all 60s (and some other stuff to, webserver and so on..)

So with some debug output and packet-sniffing i found out the retrieving
works, and dhcp_bind works and after dhcp_bind netif->ip_addr is set
correctly, but the device does not more answer on pings, nor it answers
on arp-requests.

When I set the address manually this all works. Where's my mistake?

Kind Ragards,

Dominik


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


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


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




reply via email to

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