lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] ARP problem (CONFIRMED 0.7.0 BUG)


From: Leon Woestenberg
Subject: Re: [lwip-users] ARP problem (CONFIRMED 0.7.0 BUG)
Date: Thu, 05 Feb 2004 19:48:08 -0000

Stephen,

> Mr. Woestenberg
>
That's just Leon for just almost everyone.

>     Thank you for fixing it.
>
Just did, in a new branch called STABLE-0_7 where all the bug fixes
to 0.7.0 go.

>     Another behavior in etharp.c is that when a ARP packet not for us was
> received.
>     lwIP will update two arp entry :
>         1. update_arp_entry(netif, &(hdr->sipaddr), &(hdr->shwaddr), 0);
>         2. update_arp_entry(netif, &(hdr->dipaddr), &(hdr->dhwaddr), 0);
>     The hdr->dhwaddr is usually 00:00:00:00:00:00 in an ARP Request
packet.
>     So, should we avoid updating destination address in the ARP request?
>
Funny, I just noticed this when fixing the earlier bug and made a TODO
notice.
Thanks for your sharpness! Will fix it right away.

>     Or this actually do no harm to the address resolution protocol.
>
The 0.7.0 etharp.c implementation can be considered broken in the
sense that the ARP table was cluttered with Ethernet<->IP mappings
of our own interface (which is never referenced).

So the cache was hardly helpful, which may have caused performance
trouble or lost packets.

ARP requests are usually unicasted to their requester, so updating by
snooping will not work there. I have removed that code. It is not in
RFC 826 either.

Regards,

Leon.


>     Thank you!
>
> Best Regards,
> Stephen Chen
>
>
> ----- Original Message -----
> From: "Leon Woestenberg" <address@hidden>
> To: "Mailing list for lwIP users" <address@hidden>
> Sent: Wednesday, February 04, 2004 10:25 PM
> Subject: Re: [lwip-users] ARP problem (CONFIRMED 0.7.0 BUG)
>
>
> >
> > On Wed, 4 Feb 2004 12:09:46 +0800, "stephen" <address@hidden>
said:
> > > Hi:
> > >
> > >     I am porting lwIP to a very compact RTOS.
> > >     Is there document for porting guide or port instructions?
> > >     Really appreciate if you can provide any information.
> > >     I will make porting instructions if I can port lwIP to my platform
> > >     successfully.
> > >
> > Check out the contrib ports. Unfortunately, documentation in lwIP is
> > either
> > absent, outdated.
> >
> > The best documentation is to be found in the source code, as
> > JavaDoc/Doxygen
> > stuff.
> >
> > We would welcome any specific or non-specific porting guide.
> >
> > >     One problem is about handling ARP request in etharp.c(lwIP version
> > >     0.7)
> > >         line 550 => hdr->shwaddr.addr[i] = ethaddr->addr[i];
> > >         line 586 => update_arp_entry(netif, &(hdr->sipaddr),
> > >         &(hdr->shwaddr), ARP_INSERT_FLAG);
> > >
> > >     Looks like "hdr->shwaddr" was changed before ARP table being
update.
> > >     Is that correct?
> > >
> > Wow. Yes. Bug Alert.
> >
> > >     Thank you!
> > >
> > I think you found a bug introduced through re-ordering the ARP workings.
> > This bug _may_ have caused the performance loss someone else noted.
> >
> > The fix is as follows: Move this piece of etharp.c code above the switch
> > statement (directly above it).
> >
> > ---
> >   /* add or update entries in the ARP cache */
> >   if (for_us) {
> >     /* insert IP address in ARP cache (assume requester wants to talk to
> >     us)
> >      * we might even send out a queued packet to this host */
> >     update_arp_entry(netif, &(hdr->sipaddr), &(hdr->shwaddr),
> >     ARP_INSERT_FLAG);
> >   /* request was not directed to us, but snoop anyway */
> >   } else {
> >     /* update or insert the source IP address in the cache */
> >     update_arp_entry(netif, &(hdr->sipaddr), &(hdr->shwaddr), 0);
> >     /* update or insert the destination IP address pair in the cache */
> >     update_arp_entry(netif, &(hdr->dipaddr), &(hdr->dhwaddr), 0);
> >   }
> > ---
> >
> > I do not have development tools available here. I'll fix this if no-one
> > else has, tonight or tomorrow.
> >
> > Thanks,
> >
> > Leon.
> >
> > --
> > http://www.fastmail.fm - Same, same, but different.
> >
> >
> > _______________________________________________
> > lwip-users mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/lwip-users
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/lwip-users
>





reply via email to

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