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

Submitted by:  Joel Cunningham <jcunningham>
Submitted on:  Mon 06 Nov 2017 04:59:07 PM UTC  
 
Category: Network driversSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Joel Cunningham <jcunningham>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

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

Fix committed in 637bce91b45c855964f549f91bc41a32317eac4c

Joel Cunningham <jcunningham>
Project MemberIn charge of this item.
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>
Project Member
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>
Project MemberIn charge of this item.
Wed 08 Nov 2017 07:48:25 AM UTC, comment #1:

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

Dirk Ziegelmeier <dziegel>
Project Member
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>
Project MemberIn charge of this item.

 

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 dziegel (Posted a comment)
  • -unavailable- added by jcunningham (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 Nov 2017 07:41:38 PM UTCjcunninghamStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Wed 08 Nov 2017 04:04:49 PM UTCjcunninghamStatusNone=>In Progress
      Assigned toNone=>jcunningham

    Back to the top


    Powered by Savane 3.1-cleanup1