Re: BUG: 2 NICs on same network

From: dean gaudet (dean-list-linux-kernel@arctic.org)
Date: Tue Apr 23 2002 - 12:04:39 EST


On Tue, 23 Apr 2002, Frank Louwers wrote:

> We recently stummed across a rather annoying bug when 2 nics are on
> the same network.

the powers that be consider this a feature, for reasons i've never quite
understood. your question comes up regularly, and typically the
suggestion is some convoluted filtering thing, and i've never been
sufficiently convinced the filter is worth the overhead. (especially in
my case when i wanted two interfaces for performance reasons.)

last i investigated this problem the kernel actually sent arp responses
out *both* interfaces, and it was basically a race condition as to which
the recipient would use.

anyhow, below is a patch i created for 2.4.2... hopefully it still works.
apply this and also disable proxy arp in /proc/somewhere.

-dean

--- linux/net/ipv4/arp.c.badproxy Mon Feb 12 17:28:48 2001
+++ linux/net/ipv4/arp.c Tue Feb 13 20:06:37 2001
@@ -737,10 +737,12 @@
                 addr_type = rt->rt_type;

                 if (addr_type == RTN_LOCAL) {
+ if ((rt->rt_flags&RTCF_DIRECTSRC) || IN_DEV_PROXY_ARP(in_dev)) {
                         n = neigh_event_ns(&arp_tbl, sha, &sip, dev);
                         if (n) {
                                 arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha);
                                 neigh_release(n);
+ }
                         }
                         goto out;
                 } else if (IN_DEV_FORWARD(in_dev)) {

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



This archive was generated by hypermail 2b29 : Tue Apr 23 2002 - 22:00:35 EST