buglwIP - A Lightweight TCP/IP stack - Bugs: bug #34684, Clear the arp table cache when...

 
 

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

bug #34684: Clear the arp table cache when netif is brought down

Submitter:  Amir Shalem <amirshalem>
Submitted:  Sat 29 Oct 2011 01:41:36 PM UTC
   
 
Category:  ARP Severity:  3 - Normal
Item Group:  Change Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Jump to the original submission

Thu 24 Nov 2011 08:13:46 PM UTC, comment #14: 

Ooops, thanks for catching that. I started with applying your patch and didn't notice it...

Fixed.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 24 Nov 2011 08:00:48 PM UTC, comment #13: 

The patch committed to git is bad, as it doesn't update the `netif` member (if SNMP is disabled).

My original patch is faulty as-well, sorry for that. It happened because my local repo contained patch #34682 & #34681.

Amir Shalem <amirshalem>
Tue 22 Nov 2011 08:47:04 PM UTC, comment #12: 

Fixed, thanks for the patch.

I've come to the conclusion that it's safest to remove all entries - even static ones.

Simon Goldschmidt <goldsimon>
Group administrator
Sun 13 Nov 2011 04:05:28 PM UTC, comment #11: 


> On second thoughts this should be considered for 1.4.1 as
> current code is arguably incorrect behaviour.


Agreed. However, since this code needs a netif associated to arp table entries (which we currently only have when SNMP is enabled), this will increase RAM usage. Most users will only have one netif (aside from the loopif, maybe - which doesn't use ARP). In that case, this change increases RAM usage unnecessarily.

Plus I'm still not convinced static entries should be removed. I don't think this is what users would expect in an embedded system.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 10 Nov 2011 04:36:58 PM UTC, comment #10: 

On second thoughts this should be considered for 1.4.1 as current code is arguably incorrect behaviour.

Kieran Mansley <kieranm>
Group Member
Thu 10 Nov 2011 04:35:27 PM UTC, comment #9: 

OK

Kieran Mansley <kieranm>
Group Member
Tue 08 Nov 2011 05:51:21 AM UTC, comment #8: 

Agreed.
Static & Dynamic goes clear when interface is link/netif goes down.
Better to clear.. ARP layer is there to verify addresses :)
Then we keep the original patch intact, without a change, right?

Amir Shalem <amirshalem>
Tue 01 Nov 2011 12:55:01 PM UTC, comment #7: 

I guess the logic is that if someone unplugs a cable there's a reasonable chance that it is going to get plugged back in to somewhere else, possibly a different broadcast domain, and so ARP might need to re-verify addresses.

Kieran Mansley <kieranm>
Group Member
Sat 29 Oct 2011 08:07:12 PM UTC, comment #6: 

well even if that's windows behavior iwouldnt want that as user. someone unplug the cable for"second", and my static entries are gone? I don't want that...
even if the second turns to hour.
but if the shuts down the interface then clear everything

Amir Shalem <amirshalem>
Sat 29 Oct 2011 07:59:59 PM UTC, comment #5: 

Well, I just ran a quick test in a windows VM and there, static entries also fade away when I unplug the cable... I don't know about unixes, however.

Simon Goldschmidt <goldsimon>
Group administrator
Sat 29 Oct 2011 07:46:13 PM UTC, comment #4: 

uhm I think for link down we need to reset only the dyanmic, if anything at all.
what do you think?

Amir Shalem <amirshalem>
Sat 29 Oct 2011 07:40:20 PM UTC, comment #3: 

Oh, OK, I wouldn't have thought the static entries disappear, but you're right: they do.

Wouldn't we want to clear the ARP cache also when the cable is plugged (i.e. when netif_set_link_down() is called)?

As this depends on ARP table entries having a netif assigned, this won't make it in to 1.4.1, I guess. I think we might need a config option for single- or multiple netifs (loopback not counted) to keep the code small for single-netif setups.

Simon Goldschmidt <goldsimon>
Group administrator
Sat 29 Oct 2011 05:47:38 PM UTC, comment #2: 

I thought about it, but then I decided to keep the same semantics as other OS I know.
they delete all records when interface is down, static and dynamic.

As side note if you commit this patch, please rename the function to a better name,
maybe add a netifapi for it? if you don't I will post a patch for it tomorrow.

Amir Shalem <amirshalem>
Sat 29 Oct 2011 05:37:12 PM UTC, comment #1: 

Good idea. However, shouldn't the static entries remain?

Simon Goldschmidt <goldsimon>
Group administrator
Sat 29 Oct 2011 01:41:36 PM UTC, original submission:  

Clear the arp table cache when netif is brought down,
Both dynamic & static entries are cleared.

Patch included

Amir Shalem <amirshalem>

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by amirshalem (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-11-22 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2011-11-10 kieranm Planned Release1.5.0 1.4.1
    2011-11-10 kieranm Planned Release 1.5.0
    2011-10-29 amirshalem Attached File- Added 0001-clear-the-arp-table-cache-when-netif-is-brought-down.patch, #24242

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code