buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28342, Many unnecessary records in ARP...

 
 

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

bug #28342: Many unnecessary records in ARP table

Submitted by:  Martin Persich <persich>
Submitted on:  Fri 18 Dec 2009 08:05:45 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

Sun 14 Feb 2010 06:12:38 PM UTC, comment #2:

You're right, find_entry has been broken so that a new entry always has been created until the table was full. I fixed it the way you suggested, thanks for the input!

I also turned off ETHARP_TRUST_IP_MAC by default since it slows down reception of every packet and other systems don't do it that way, too.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sun 27 Dec 2009 12:11:17 PM UTC, comment #1:

I'd be cautious making such a change as the ARP RFC (826) clearly states to add all received broadcasts to the table to prevent too many broadcasts at a later time (if the host that ignored the broadcast before now needs it). If at all this should be an option defaulting to off.

However, the default for ARP is still to prevent broadcasts where possible and costumers buying a device will probably expect it to behave like that if it says it's corresponding to the RFC 826!

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 18 Dec 2009 08:05:45 PM UTC, original submission:

I found full ARP table with 16 items in very short time during my testing of ARP protocol in my project (Atmel AVR32 UC3A0512). I discovered that in this table is many unused IP addresses from my LAN. I found that every incoming IP address in ARP Request Packet from LAN is stored to "arp_table". It is better if in ARP table is only addresses which is necessary for MCU communication, not all from LAN, I think. It is reduce MCU utilization, I think.
I found flag "ETHARP_FIND_ONLY" in file "etharp.c" and I made two small changes:
line #605 in "etharp.c" (Rev 1.153):
old: update_arp_entry(netif, &(iphdr->src), &(ethhdr->src), 0);
new: update_arp_entry(netif, &(iphdr->src), &(ethhdr->src), ETHARP_FIND_ONLY);
line #702:
old: update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), 0);
new: update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), ETHARP_FIND_ONLY);
With this changes ARP works ok - I think ... :-) - and in ARP table are only used IP addresses not all LANs.
And one idea. Is it possible move declaration of "struct etharp_entry" and "enum etharp_state" from "etharp.c" to "etharp.h", remove "static" from arp_table definition and add declaration of "arp_table" in "etharp.h" for diagnostics purpose ? There is not semaphore to this structure, I know ... But for diagnostic it is not necessary, I think.

Martin Persich <persich>

 

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 goldsimon (Posted a comment)
  • -unavailable- added by persich (Submitted the item)
  • -unavailable- added by persich
  •  

    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
    Sun 14 Feb 2010 06:12:38 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 18 Dec 2009 08:05:45 PM UTCpersichCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1