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

Submitted by:  Amir Shalem <amirshalem>
Submitted on:  Sat 29 Oct 2011 01:41:36 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

(Jump to the original submission 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project Administrator
Thu 10 Nov 2011 04:35:27 PM UTC, comment #9:

OK

Kieran Mansley <kieranm>
Project Administrator
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>
Project Administrator
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Nov 2011 08:47:04 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Thu 10 Nov 2011 04:36:58 PM UTCkieranmPlanned Release1.5.0=>1.4.1
    Thu 10 Nov 2011 04:35:27 PM UTCkieranmPlanned Release=>1.5.0
    Sat 29 Oct 2011 01:41:36 PM UTCamirshalemAttached File-=>Added 0001-clear-the-arp-table-cache-when-netif-is-brought-down.patch, #24242

    Back to the top


    Powered by Savane 3.1-cleanup1