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.
|
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!
|
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.
|