Ethernet Bridge development
 help / color / mirror / Atom feed
From: Diego Liziero <diego.liziero@unimore.it>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: bluez-devel@lists.sourceforge.net, bridge@osdl.org,
	kishoreak@myw.ltindia.com
Subject: [Bridge] Re: [1/11] bridge - handle delete of multiple devices with same address
Date: Mon, 24 May 2004 11:08:11 +0200	[thread overview]
Message-ID: <1085389690.6767.15.camel@igno> (raw)
In-Reply-To: <20040521154511.1d7b896d@dell_ss3.pdx.osdl.net>

Great work Stephen, just tested with Bluetooth PAN
and everything works now.

For the bluetooth people, here is the bk link to the patch:
http://linux.bkbits.net:8080/linux-2.5/cset@40afb9c8_3WOgNFCBlahWsksS_5icQ?nav=index.html|ChangeSet@-3d

Thanks to all the people that helped me.
Regards,
Diego.

On Sat, 2004-05-22 at 00:45, Stephen Hemminger wrote:
> 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);


      reply	other threads:[~2004-05-24  9:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-21 22:45 [Bridge] [1/11] bridge - handle delete of multiple devices with same address Stephen Hemminger
2004-05-24  9:08 ` Diego Liziero [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1085389690.6767.15.camel@igno \
    --to=diego.liziero@unimore.it \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=bridge@osdl.org \
    --cc=kishoreak@myw.ltindia.com \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox