diff options
author | stephen hemminger <shemminger@vyatta.com> | 2011-03-24 09:24:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-28 02:35:02 -0400 |
commit | edf947f10074fea27fdb1730524dca59355a1c40 (patch) | |
tree | 4141cd2fa39ae589055057e912d3235150d670c5 /net/bridge/br_stp_if.c | |
parent | 8628bd8af7c4c14f40f5183f80f5744c4e682439 (diff) |
bridge: notify applications if address of bridge device changes
The mac address of the bridge device may be changed when a new interface
is added to the bridge. If this happens, then the bridge needs to call
the network notifiers to tickle any other systems that care. Since bridge
can be a module, this also means exporting the notifier function.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_stp_if.c')
-rw-r--r-- | net/bridge/br_stp_if.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 79372d4a4055..5593f5aec942 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c | |||
@@ -204,7 +204,7 @@ void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr) | |||
204 | static const unsigned short br_mac_zero_aligned[ETH_ALEN >> 1]; | 204 | static const unsigned short br_mac_zero_aligned[ETH_ALEN >> 1]; |
205 | 205 | ||
206 | /* called under bridge lock */ | 206 | /* called under bridge lock */ |
207 | void br_stp_recalculate_bridge_id(struct net_bridge *br) | 207 | bool br_stp_recalculate_bridge_id(struct net_bridge *br) |
208 | { | 208 | { |
209 | const unsigned char *br_mac_zero = | 209 | const unsigned char *br_mac_zero = |
210 | (const unsigned char *)br_mac_zero_aligned; | 210 | (const unsigned char *)br_mac_zero_aligned; |
@@ -222,8 +222,11 @@ void br_stp_recalculate_bridge_id(struct net_bridge *br) | |||
222 | 222 | ||
223 | } | 223 | } |
224 | 224 | ||
225 | if (compare_ether_addr(br->bridge_id.addr, addr)) | 225 | if (compare_ether_addr(br->bridge_id.addr, addr) == 0) |
226 | br_stp_change_bridge_id(br, addr); | 226 | return false; /* no change */ |
227 | |||
228 | br_stp_change_bridge_id(br, addr); | ||
229 | return true; | ||
227 | } | 230 | } |
228 | 231 | ||
229 | /* called under bridge lock */ | 232 | /* called under bridge lock */ |