lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] ARP ETHARP_TRY_HARD


From: Paul C
Subject: Re: [lwip-users] ARP ETHARP_TRY_HARD
Date: Wed, 01 Dec 2004 21:14:31 +1030

Hi Leon,

I think that those changes fix all the issues I found. With for_us = 1
I had seen arp replies when a gratuious arp was sent to 0.0.0.0
they seem to have gone with that last dhcp_arp_reply() change. 
I'll rebuild with a fresh cvs checkout, and make sure.

I do have a problem with ARP_QUEUEING in previous versions on LWIP
there was only one packet queued on the ARP now it seems that it is
possible to continuously add packets to the queue. This is good when
there is a reply to the arp but if the ip address does not exist then
it is possible to exhaust memory buffers. What I would like is a 
new error value ERR_ARP_PENDING so that if a packet is not sent but
an Arp request instead (the packet is either lost or queued) the return
value is not ERR_OK but ERR_ARP_PENDING or ERR_ARP_SENT. That way I 
dont keep mindlessly sending packets to a non existant ip address. 
Any comment?


Paul




On Tue, 30 Nov 2004 18:18:33 +0100, "Leon Woestenberg"
<address@hidden> said:
> Hello Paul,
> 
> Paul Clarke wrote:
> 
> >Hi Leon.
> >
> >The reason why line 494 needs to be for_us = 1;
> >A few lines later we have
> >
> >  case ARP_REPLY:
> >    /* ARP reply. We already updated the ARP cache earlier. */
> >    LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_arp_input: incoming ARP
> >reply\n"));
> >#if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
> >    /* DHCP wants to know about ARP replies to our wanna-have-address */
> >    if (for_us) dhcp_arp_reply(netif, &sipaddr);
> >#endif
> >    break;
> >
> >The other option is to change the code there to
> >
> >#if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
> >    /* DHCP wants to know about ARP replies to our wanna-have-address */
> >    if (for_us || (netif->ip_addr.addr == 0)) dhcp_arp_reply(netif,
> >&sipaddr);
> >#endif
> >
> >Which is better?
> >  
> >
> The first is not OK as the for_us also works for all ARP traffic, 
> requests as well. Setting for_us = 1
> for a request when the interface is not configured would be bad.
> 
> The last one is better, although I now spot a subtle bug in the current 
> code:
> 
> If the interface in non-configured (0.0.0.0), for_us will be 0 and the 
> dhcp_arp_reply() will not be
> called.
> 
> This would be correct:
> 
> #if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
>     /* When unconfigured, DHCP wants to know about ARP replies from the
>      * address offered to us, as that means someone else uses it already!
>      */
>     if (netif->ip_addr.addr == 0) dhcp_arp_reply(netif, &sipaddr);
> #endif
> 
> Changed in CVS.
> 
> Regards,
> 
> Leon.
> 
> 
> 
> 
> 
> _______________________________________________
> 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]