lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] ARP requests but no reply


From: David Empson
Subject: Re: [lwip-users] ARP requests but no reply
Date: Mon, 12 Apr 2010 10:19:32 +1200

"Robert Schilling" <address@hidden> wrote:
I'm trying to port port lwIP to a ARM Cortex M3 NXP LPC1768.
I'm using following Example: http://www.coocox.com/EXAMPLE/NXP_LPC1766_ARMCC.htm

If I want to ping the device, ARP requests of the host computer are coming in, but the device doesn't reply them.

I could isolate the problem to the function update_arp_entry() where the reply should be started. There is a loop, where the queued packets should be sent: while (arp_table[i].q != NULL).

In my case arp_table[0] gets initialized but arp_table[0].q is always NULL.
For this reason I don't get an ARP reply.

Hi Robert

You misunderstand the purpose of that queue.

arp_table[i].q is used to hold outgoing IP packets which have not yet been sent because LWIP didn't know the MAC address of the destination device. In this situation, LWIP issues an ARP request while queueing the outgoing IP packet, and when the ARP reply arrives from the other device, pending packets can be sent. In your case there is nothing on that queue because LWIP hasn't tried to send any IP packets yet.

Your problem is the opposite way around: the other device is sending an ARP request, and LWIP is not sending the ARP reply.

When an ARP request is received, LWIP calls update_arp_entry() as a side effect: the incoming ARP request provides enough information for LWIP to update an entry in its own (outgoing) address table, saving LWIP from having to issue its own ARP request if it needs to send something to the IP address of the other device.

This call to update_arp_entry() is from etharp_arp_input(). The code to send the ARP reply is a little further down that function. Find "case ARP_REQUEST". The code there construct an ARP reply and calls netif->linkoutput() to send it. You should trace through that code and work out why the transmission is not occurring.

The most likely explanation is that for some reason your Ethernet driver is unable to transmit anything.





reply via email to

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