RE: (In my eyes) strange arp behaviour

Jordan Russell (jrlk@webby.dhs.org)
Thu, 30 Dec 1999 20:13:01 -0600 (CST)


I have a new machine with the same config (2 NICs, same hub) and it was
experiencing intermittent problems communicating with other systems, and
after 2 days of trying to debug the problem, I finally discovered it was
caused by both cards replying to ARP requests.

After installing your patch, everything works perfectly! Thanks a lot!

I totally agree with you that the current ARP behavior is incorrect. Or,
at very least, without the patch the system is simply unusable.

Jordan Russell

In article <fa.dm07gdv.135o61l@ifi.uio.no>,
Florian Heinz <sky@real-linux.de> wrote:
> Hi,
>
> I have a machine connected with 2 network-cards to the same hub...
I've
> assigned the IP 192.168.0.1 to one card and 192.168.0.2 to the other.
>
> Now when an arp-request for, e.g. 192.168.0.1 arrives, _both_ cards
> reply with their own HW-address.
>
> I think this behaviour comes because the arp-code only checks if the
> IP-address is local, but _not_ if it's assigned to the device which
> replies.
>
> I don't think this behaviour is correct.. I've wrote a quick fix for
it.
> Well, it works fine for me, possibly it breaks some other cases... who
> knows ;)
>
> --- arp.old.c Wed Oct 20 02:14:02 1999
> +++ arp.c Wed Dec 29 16:40:40 1999
> @@ -661,6 +661,17 @@
>
> if (arp->ar_op == __constant_htons(ARPOP_REQUEST) &&
> ip_route_input(skb, tip, sip, 0, dev) == 0) {
> +
> + /* This block prevents devices to reply to arp-requests for
> IPs
> + * which are local, but not assigned to the
> device */
> + struct in_ifaddr *myaddr = in_dev->ifa_list;
> + while (myaddr) {
> + if (myaddr->ifa_local == tip)
> + break;
> + myaddr = myaddr->ifa_next;
> + }
> + if (!myaddr)
> + goto out;
>
> rt = (struct rtable*)skb->dst;
> addr_type = rt->rt_type;
>
> Yes, I know, there are 100 better ways and places to do this...
>
> Any comments? (But, please, no discussions about the stupidity of
> connecting two network-cards to the same hub)
>
> FH

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/