aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_notify.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-03-22 17:08:46 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:48 -0400
commitb86c45035c439cfa6ef5b2e4bf080b24bd8765f1 (patch)
treeb77fee73c5c5536eef58ae5c8366f7bbe8cacf31 /net/bridge/br_notify.c
parent9cde070874b822d4677f4f01fe146991785813b1 (diff)
bridge: change when netlink events go to STP
Need to tell STP daemon about more events, like any time a device is added even when it is down. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Diffstat (limited to 'net/bridge/br_notify.c')
-rw-r--r--net/bridge/br_notify.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 37357ed2149b..c8451d3a070c 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -50,7 +50,6 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
50 case NETDEV_CHANGEADDR: 50 case NETDEV_CHANGEADDR:
51 spin_lock_bh(&br->lock); 51 spin_lock_bh(&br->lock);
52 br_fdb_changeaddr(p, dev->dev_addr); 52 br_fdb_changeaddr(p, dev->dev_addr);
53 br_ifinfo_notify(RTM_NEWLINK, p);
54 br_stp_recalculate_bridge_id(br); 53 br_stp_recalculate_bridge_id(br);
55 spin_unlock_bh(&br->lock); 54 spin_unlock_bh(&br->lock);
56 break; 55 break;
@@ -74,10 +73,11 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
74 break; 73 break;
75 74
76 case NETDEV_UP: 75 case NETDEV_UP:
77 spin_lock_bh(&br->lock); 76 if (netif_carrier_ok(dev) && (br->dev->flags & IFF_UP)) {
78 if (netif_carrier_ok(dev) && (br->dev->flags & IFF_UP)) 77 spin_lock_bh(&br->lock);
79 br_stp_enable_port(p); 78 br_stp_enable_port(p);
80 spin_unlock_bh(&br->lock); 79 spin_unlock_bh(&br->lock);
80 }
81 break; 81 break;
82 82
83 case NETDEV_UNREGISTER: 83 case NETDEV_UNREGISTER:
@@ -85,5 +85,10 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
85 break; 85 break;
86 } 86 }
87 87
88 /* Events that may cause spanning tree to refresh */
89 if (event == NETDEV_CHANGEADDR || event == NETDEV_UP ||
90 event == NETDEV_CHANGE || event == NETDEV_DOWN)
91 br_ifinfo_notify(RTM_NEWLINK, p);
92
88 return NOTIFY_DONE; 93 return NOTIFY_DONE;
89} 94}