buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28877, Duplicate ARP gratuitous packet...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28877: Duplicate ARP gratuitous packet with LWIP_NETIF_LINK_CALLBACK set ON

Submitted by:  Martin Persich <persich>
Submitted on:  Fri 12 Feb 2010 04:22:24 PM UTC  
 
Category: ARPSeverity: 3 - Normal
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Sun 14 Feb 2010 08:22:27 PM UTC, comment #2:

Fixed in a slightly different way. Thanks for reporting.

> when the NETIF is initialized for the first time and then I
> immediately call function "netif_set_link_up"


You should know that the correct way to do it is to set NETIF_FLAG_LINK_UP to your netif's flag inside your ethernetif_init function if the link is up at that time already.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 12 Feb 2010 04:50:27 PM UTC, comment #1:

What about this:

if (netif->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP)) {
etharp_gratuitous(netif);
}

Since netif_set_link_up() does it the same way (only sending if netif is up), only the latter of both (set_up and set_link_up) would issue the gratuitous ARP.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 12 Feb 2010 04:22:24 PM UTC, original submission:

I made upgrade of Atmel's ethernet driver (AVR32 UC3A) to allow restart of autonegotation process if cable is disconnected and then connected to switch with other speed or characteristics (HDX/FDX, ...). I suppose that for this is prepared functions "netif_set_link_up" and "netif_set_link_down" in LwIP. I call function "netif_set_up" in the moment, when the NETIF is initialized for the first time and then I immediately call function "netif_set_link_up". On every moment when the cable is disconnected or connected back (information from the PHY interface) - I call functions "netif_set_link_down" or "netif_set_link_up". But with this scenario is ARP gratuitous packet sending twice in the beginning. I made small change in "netif_set_up" function which solve this problem, I think. Do you have better solution for this ? I don't use DHCP and I don't revolve problem with probably required restart of DHCP process in this situation ...

void netif_set_up(struct netif *netif)
{
...

#if LWIP_ARP && ! LWIP_NETIF_LINK_CALLBACK
/* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */
if (netif->flags & NETIF_FLAG_ETHARP) {
etharp_gratuitous(netif);
}
#endif /* LWIP_ARP */

...
}

Martin Persich

Martin Persich <persich>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by persich (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 14 Feb 2010 08:22:27 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1