lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] parameter for netif_add in UDP


From: Ben Bobbitt
Subject: Re: [lwip-users] parameter for netif_add in UDP
Date: Thu, 14 Feb 2008 08:40:23 -0600
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)


Yes, the DHCP part seems to be working. I see the transactions on the wire and my app is able to retrieve the new IP address.  I am also able to transmit UDP packets. 

I've seen a couple of flavors of the receive issue.  In one situation the transmitting system sends out the ARP packet looking for the proper device to associate with that IP, and the ARP module in lwIP doesn't seem to recognize that it is directed to him.  It seems that in other instances ( using a different transmitting system ), there is no ARP request preceding the transmit, and that's when my system responds with the ICMP port unreachable.  Both symptoms would still seem to point to some setup problem with the netif. 

  
Thanks for the quick response.  I'm a little confused by the driver comment,
though.  What should I have to do in that regard?  
    

It will be part of the driver itself. If someone else gave you the driver,
then they probably did the right thing. Look at the driver source for the
existence of calls to functions such as etharp_ip_input(). If it's got
them, then that's fine and all I was referring to.

  
The symptom that I am seeing (using wireshark to view the packets ) is that
my system is sending out an ICMP reject (port unreachable) when the UDP
packets reach him. This would seem to indicate some problem with the setup
in regard to the UDP service.  

Here's what I am doing to set up the interface...
My addresses at this point are all 0 because of using DHCP

sys_init();
  mem_init();
  memp_init();
  pbuf_init();
  netif_init();
  ip_init();  
  udp_init(); 
  tcpip_init( prvEthernetConfigureInterface, NULL );
    

Strictly you should not call ip_init and udp_init directly - tcpip_init
does that. But this won't be the source of your problem as the current
implementation of those functions are ok to call multiple times.

  
where in prvEthernetConfigureInterface:

netif_add(&MACB_if, &xIpAddr, &xNetMask, &xGateway, NULL, ethernetif_init,
tcpip_input);
netif_set_default(&MACB_if);
dhcp_start(&MACB_if);

in my UDP task, I'm waiting while MACB_if.dhcp->state != DHCP_BOUND before
calling netconn_new().   
    

So does DHCP succeed? Does it successfully send a packet? And receive one?

Jifl
  


reply via email to

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