lkml.org 
[lkml]   [2002]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: BUG: 2 NICs on same network
Hi!

On Tue, 23 Apr 2002, Frank Louwers wrote:

> Hi,
>
> We recently stummed across a rather annoying bug when 2 nics are on
> the same network.
>
> Our situation is this: we have a server with 2 nics, each with a
> different IP on the same network, connected to the same switch. Let's
> assume eth0 has ip 1.2.3.1 and eth1 has 1.2.3.2, with a both with a
> netmask of 255.255.255.0.
>
> Now the strange thing is that traffic for 1.2.3.2 arrives at eth0 no
> matter what!
>
This is in perfect agreement with rfc1122, section 3.3.4.2. Linux uses the
weak ES model, so the interface doesn't matter. There was once a patch
floating around for 2.4.6 that made the kernel accept only arp coming from
the 'right' interface. arp_self_only, or something. I have attached it,
but I have no idea if it still applies/works.

Ciao,
Roland

+---------------------------+-------------------------+
| TU Muenchen | |
| Physik-Department E18 | Raum 3558 |
| James-Franck-Str. | Telefon 089/289-12592 |
| 85747 Garching | |
+---------------------------+-------------------------+
diff -Naur --exclude=.* --exclude=*.o linux-2.4.6.1/net/ipv4/arp.c linux-2.4.6/net/ipv4/arp.c
--- linux-2.4.6.1/net/ipv4/arp.c Wed May 16 19:21:45 2001
+++ linux-2.4.6/net/ipv4/arp.c Thu Aug 9 16:20:57 2001
@@ -760,6 +760,9 @@
int dont_send = 0;
if (IN_DEV_ARPFILTER(in_dev))
dont_send |= arp_filter(sip,tip,dev);
+ if (IN_DEV_ARP_SELF_ONLY(in_dev))
+ if (dev != ip_dev_find(tip))
+ dont_send = 1;
if (!dont_send)
arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha);

diff -Naur --exclude=.* --exclude=*.o linux-2.4.6.1/net/ipv4/devinet.c linux-2.4.6/net/ipv4/devinet.c
--- linux-2.4.6.1/net/ipv4/devinet.c Wed May 16 19:21:45 2001
+++ linux-2.4.6/net/ipv4/devinet.c Thu Aug 9 16:20:57 2001
@@ -1016,7 +1016,7 @@
static struct devinet_sysctl_table
{
struct ctl_table_header *sysctl_header;
- ctl_table devinet_vars[14];
+ ctl_table devinet_vars[15];
ctl_table devinet_dev[2];
ctl_table devinet_conf_dir[2];
ctl_table devinet_proto_dir[2];
@@ -1062,6 +1062,9 @@
{NET_IPV4_CONF_ARPFILTER, "arp_filter",
&ipv4_devconf.arp_filter, sizeof(int), 0644, NULL,
&proc_dointvec},
+ {NET_IPV4_CONF_ARP_SELF_ONLY, "arp_self_only",
+ &ipv4_devconf.arp_self_only, sizeof(int), 0644, NULL,
+ &proc_dointvec},
{0}},

{{NET_PROTO_CONF_ALL, "all", NULL, 0, 0555, devinet_sysctl.devinet_vars},{0}},

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.098 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site