2 * Device event handling
3 * Linux ethernet bridge
6 * Lennert Buytenhek <buytenh@gnu.org>
8 * $Id: br_notify.c,v 1.2 2000/02/21 15:51:34 davem Exp $
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
16 #include <linux/kernel.h>
18 #include "br_private.h"
20 static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr);
22 struct notifier_block br_device_notifier =
24 .notifier_call = br_device_event
27 static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
29 struct net_device *dev;
30 struct net_bridge_port *p;
31 struct net_bridge *br;
41 spin_lock_bh(&br->lock);
44 case NETDEV_CHANGEADDR:
45 br_fdb_changeaddr(p, dev->dev_addr);
46 if (br->dev->flags & IFF_UP)
47 br_stp_recalculate_bridge_id(br);
51 if (br->dev->flags & IFF_UP)
52 br_stp_disable_port(p);
56 if (br->dev->flags & IFF_UP)
57 br_stp_enable_port(p);
60 case NETDEV_UNREGISTER:
64 spin_unlock_bh(&br->lock);