[Bridge] [PATCH] bridge -- fix for multiple ports with same address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> hi 
> seems a bug due to changes in 2.6.6 in mcast and bridge infrastructure 
> under 2.6.5 same thing works 
> description 
> I want to add some vlans with same adress , in one bridge 
> for pppoe server access concentrator , and some clients with static ip adresses , but in
> different vlans

The bridge code was being to picky. The bridge will still work fine when
there are two interfaces with the same local address, because it is only
used for setting the source address on the outgoing bridge packets.

This should fix it.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1543  -> 1.1544 
#	 net/bridge/br_fdb.c	1.11    -> 1.12   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/05/10	shemminger@xxxxxxxx	1.1544
# Allow multiple interfaces with same address (necessary for VLAN's).
# --------------------------------------------
#
diff -Nru a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
--- a/net/bridge/br_fdb.c	Mon May 10 13:45:50 2004
+++ b/net/bridge/br_fdb.c	Mon May 10 13:45:50 2004
@@ -277,18 +277,18 @@
 		if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
 			/* attempt to update an entry for a local interface */
 			if (unlikely(fdb->is_local)) {
-				if (is_local) 
-					printk(KERN_INFO "%s: attempt to add"
-					       " interface with same source address.\n",
-					       source->dev->name);
-				else if (net_ratelimit()) 
-					printk(KERN_WARNING "%s: received packet with "
-					       " own address as source address\n",
-					       source->dev->name);
-				ret = -EEXIST;
+				/* it is okay to have multiple ports with same 
+				 * address, just don't allow to be spoofed.
+				 */
+				if (!is_local) {
+					if (net_ratelimit()) 
+						printk(KERN_WARNING "%s: received packet with "
+						       " own address as source address\n",
+						       source->dev->name);
+					ret = -EEXIST;
+				}
 				goto out;
 			}
-
 
 			if (likely(!fdb->is_static || is_local)) {
 				/* move to end of age list */


[Index of Archives]     [Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux