Bookmark this page:
Yahoo!
Windows Live
del.icio.us
digg
Netscape
|
|
|||||||
|
Posted by James Harris on November 28, 2008, 9:00 am
Please log in for more thread options > > Good find with the arping. If I read the RFC correctly (linked RFC
> > 820) from >
> > http://en.wikipedia.org/wiki/Address_Resolution_Protocol
>
> > a host should update its arp table with the last info received. That
> > said I may have read it incorrectly - it was only a cursory scan over > > the info - or the arp handler may choose not to add an entry for the > > second update. The RFC doesn't look like it was written with this > > situation in mind. >
> I think you're right. That's how "gratuitous ARP" works to update ARP > caches when an IP moves to a new machine. > > So I find it strange that Linux uses the first ARP response received, > rather than the last. I've found a note in the Linux arp source: 893 if (n) { 894 int state = NUD_REACHABLE; 895 int override; 896 897 /* If several different ARP replies follows back-to-back, 898 use the FIRST one. It is possible, if several proxy 899 agents are active. Taking the first reply prevents 900 arp trashing and chooses the fastest router. 901 */ 902 override = time_after(jiffies, n->updated + n->parms->locktime);
903
904 /* Broadcast replies and request packets 905 do not assert neighbour reachability. 906 */ 907 if (arp->ar_op != htons(ARPOP_REPLY) ||
909 state = NUD_STALE;
908 skb->pkt_type != PACKET_HOST) 910 neigh_update(n, sha, state, override ? NEIGH_UPDATE_F_OVERRIDE : 0); 911 neigh_release(n); 912 } This looks like it checks the time since the last update in some way (line 902) to set the override variable. If the override variable is set it uses it in line 910 to select NEIGH_UPDATE_F_OVERRIDE (which is a flag setting) to send to the neigh_update routine. Perhaps that routine ignores the update if that flag bit is set. At any rate the comment is most enlightening! P.S. The above code is from http://www.gelato.unsw.edu.au/lxr/source/net/ipv4/arp.c which you can see is part of a recent 2.6 kernel. Judging by the copyright date and the lack of any mention of this behaviour in the change log it is possible this has been the Linux behaviour for some time. James | |||||||

Re: Router MAC address
Yahoo!
Windows Live
del.icio.us
digg
Netscape 

>