buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52353, netif_issue_reports() not checking...

 
 

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

bug #52353: netif_issue_reports() not checking link/netif up status

Submitter:  Joel Cunningham <jcunningham>
Submitted:  Mon 06 Nov 2017 04:59:07 PM UTC
   
 
Category:  Network drivers Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jcunningham
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Wed 08 Nov 2017 07:41:38 PM UTC, comment #4: 

Fix committed in 637bce91b45c855964f549f91bc41a32317eac4c

Joel Cunningham <jcunningham>
Group Member
Wed 08 Nov 2017 06:35:13 PM UTC, comment #3: 

+1 from me for moving the check down inside netif_issue_reports()

Dirk Ziegelmeier <dziegel>
Group administrator
Wed 08 Nov 2017 03:58:08 PM UTC, comment #2: 

I noticed one additional thing, some of the callers of netif_issue_reports are checking that the admin state and link are up.

Callers that do:

 1) netif_set_up
 2) netif_set_link_up

Callers that don't:

 1) netif_set_ipaddr
 2) netif_ip6_addr_set_parts
 3) netif_ip6_addr_set_state

So I could add additional checks to the callers in the 'don't' list or I could move the check down inside netif_issue_reports() and always call it from both above lists.

I'm more in favor of checking inside netif_issue_reports() to reduce duplicate checks and prevent new occurrences from being introduced in the future

Joel Cunningham <jcunningham>
Group Member
Wed 08 Nov 2017 07:48:25 AM UTC, comment #1: 

Sounds good, don't post a patch, just commit it

Dirk Ziegelmeier <dziegel>
Group administrator
Mon 06 Nov 2017 04:59:07 PM UTC, original submission:  

One of my netif's does the following to set a static IP address:

1) netif_set_link_up()
2) netif_set_addr()
3) netif_set_up()

I've found that steps 2 and 3 each produce a gratuitous ARP, which is unexpected.

Looking at the implementation of netif_issue_reports, I found it's not checking either the link or administrative state before calling etharp_gratuitous().  It only checks that the netif has a non-zero IP address, thus resulting in the ARP when netif_set_addr() is called even though the netif is still down.  Then when netif_set_up is called, a duplicate ARP is generated

I can provide a patch if there is consensus that netif_issue_reports() should be checking the link and admin states (in addition to IP address)



Joel Cunningham <jcunningham>
Group Member

 

(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 jcunningham (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-08 jcunningham StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2017-11-08 jcunningham StatusNone In Progress
        Assigned toNone jcunningham

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code