buglwIP - A Lightweight TCP/IP stack - Bugs: bug #55252, Gratuitous ARP sent before valid...

 
 

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

bug #55252: Gratuitous ARP sent before valid ip address is obtained

Submitter:  Pelle Bergkvist <pellebk>
Submitted:  Thu 20 Dec 2018 07:06:52 AM UTC
   
 
Category:  ARP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  2.1.1

Wed 23 Jan 2019 02:58:13 PM UTC, comment #2: 

Yes, we are running a slightly patched version, I wrongly assumed this part was not patched.

Sorry for this, the issue can be closed.

Pelle Bergkvist <pellebk>
Fri 18 Jan 2019 07:58:11 PM UTC, comment #1: 

This code does not seem to exist in git head or 2.1.2 - do you run a patched version of lwIP or do I miss something??

Currently, the only usage of etharp_gratuitous() is here, and its encapsulated with an ip4_addr_isany_val() check:

static void
netif_issue_reports(struct netif *netif, u8_t report_type)
{

[...]

#if LWIP_IPV4
  if ((report_type & NETIF_REPORT_TYPE_IPV4) &&
      !ip4_addr_isany_val(*netif_ip4_addr(netif))) {
#if LWIP_ARP && !LWIP_ACD
    /* For Ethernet network interfaces:
     * we would like to send a "gratuitous ARP".
     * Only needs to be done here if ACD isn't configured.
     */
    if (netif->flags & (NETIF_FLAG_ETHARP)) {
      etharp_gratuitous(netif);
    }

Dirk Ziegelmeier <dziegel>
Group administrator
Thu 20 Dec 2018 07:06:52 AM UTC, original submission:  

In netif_set_link_up an etharp_gratuitous is done even if the interface address is IPADDR_ANY. Suggest to change the etharp_gratuitous define to:
#define etharp_gratuitous(netif) if (!ip4_addr_isany(netif_ip4_addr(netif))) { etharp_request((netif), netif_ip4_addr(netif)); }
as this should not ever(?) be done for IPADDR_ANY

Alternative solution could be to update the if statement in netif_set_link_up(struct netif *) to
    /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */
    if (((netif->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_POINTTOPOINT)) == NETIF_FLAG_ETHARP) && !ip4_addr_isany(netif_ip4_addr(netif))) {
        etharp_gratuitous(netif);
    }

Using the latest 2.1.2 version



Pelle Bergkvist <pellebk>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by pellebk (Submitted the item)
  • -email is unavailable- added by pellebk
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-23 dziegel StatusNone Invalid
        Open/ClosedOpen Closed
    2018-12-20 pellebk Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code