All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bridge] [1/11] bridge - handle delete of multiple devices with same address
@ 2004-05-21 22:45 ` Stephen Hemminger
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2004-05-21 22:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, bridge, David Woodhouse, Diego Liziero

This fixes the issue discovered when removing bluetooth devices from a bridge.
Need to add special case code when forwarding table is being cleaned up to 
handle the case where several devices share the same hardware address.

(Could fix on 2.4 if there is demand for it)
 
diff -Nru a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
--- a/net/bridge/br_fdb.c	2004-05-20 08:43:46 -07:00
+++ b/net/bridge/br_fdb.c	2004-05-20 08:43:46 -07:00
@@ -157,9 +157,28 @@
 		hlist_for_each_safe(h, g, &br->hash[i]) {
 			struct net_bridge_fdb_entry *f
 				= hlist_entry(h, struct net_bridge_fdb_entry, hlist);
-			if (f->dst == p) {
-				fdb_delete(f);
+			if (f->dst != p) 
+				continue;
+
+			/*
+			 * if multiple ports all have the same device address
+			 * then when one port is deleted, assign
+			 * the local entry to other port
+			 */
+			if (f->is_local) {
+				struct net_bridge_port *op;
+				list_for_each_entry(op, &br->port_list, list) {
+					if (op != p && 
+					    !memcmp(op->dev->dev_addr,
+						    f->addr.addr, ETH_ALEN)) {
+						f->dst = op;
+						goto skip_delete;
+					}
+				}
 			}
+
+			fdb_delete(f);
+		skip_delete: ;
 		}
 	}
 	write_unlock_bh(&br->hash_lock);

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-05-25 11:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-21 22:45 [Bridge] [1/11] bridge - handle delete of multiple devices with same address Stephen Hemminger
2004-05-21 22:45 ` Stephen Hemminger
2004-05-24  9:08 ` [Bridge] " Diego Liziero
2004-05-24  9:08   ` [Bluez-devel] " Diego Liziero
2004-05-24  9:44   ` [Bluez-devel] Bluetooth, Mobile IPv6 and PAN profile Wang Haiguang
2004-05-24 14:00     ` Marcel Holtmann
2004-05-25  8:30       ` David Woodhouse
2004-05-25 11:18         ` Wang Haiguang
2004-05-25 11:29         ` [Bluez-devel] Some question on flush timeout at L2CAP Wang Haiguang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.