aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2015-07-09 06:11:10 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-10 00:41:11 -0400
commit09cf0211f970311383fdb453bbd5b3beeb294324 (patch)
treeac9c1a9d86ff805638696a9c1b4bd76521f4a054 /net/bridge
parentcb1c61680d29a054b91a23c7a504cea8a72bdcff (diff)
bridge: mdb: fill state in br_mdb_notify
Fill also the port group state when sending notifications. Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_mdb.c5
-rw-r--r--net/bridge/br_multicast.c5
-rw-r--r--net/bridge/br_private.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index e29ad70b3000..1fb7d076f15c 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -230,7 +230,7 @@ errout:
230} 230}
231 231
232void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port, 232void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
233 struct br_ip *group, int type) 233 struct br_ip *group, int type, u8 state)
234{ 234{
235 struct br_mdb_entry entry; 235 struct br_mdb_entry entry;
236 236
@@ -241,6 +241,7 @@ void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
241#if IS_ENABLED(CONFIG_IPV6) 241#if IS_ENABLED(CONFIG_IPV6)
242 entry.addr.u.ip6 = group->u.ip6; 242 entry.addr.u.ip6 = group->u.ip6;
243#endif 243#endif
244 entry.state = state;
244 __br_mdb_notify(dev, &entry, type); 245 __br_mdb_notify(dev, &entry, type);
245} 246}
246 247
@@ -348,7 +349,7 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
348 return -ENOMEM; 349 return -ENOMEM;
349 rcu_assign_pointer(*pp, p); 350 rcu_assign_pointer(*pp, p);
350 351
351 br_mdb_notify(br->dev, port, group, RTM_NEWMDB); 352 br_mdb_notify(br->dev, port, group, RTM_NEWMDB, state);
352 return 0; 353 return 0;
353} 354}
354 355
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 742a6c27d7a2..5a44cd9473f2 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -694,7 +694,7 @@ static int br_multicast_add_group(struct net_bridge *br,
694 if (unlikely(!p)) 694 if (unlikely(!p))
695 goto err; 695 goto err;
696 rcu_assign_pointer(*pp, p); 696 rcu_assign_pointer(*pp, p);
697 br_mdb_notify(br->dev, port, group, RTM_NEWMDB); 697 br_mdb_notify(br->dev, port, group, RTM_NEWMDB, MDB_TEMPORARY);
698 698
699found: 699found:
700 mod_timer(&p->timer, now + br->multicast_membership_interval); 700 mod_timer(&p->timer, now + br->multicast_membership_interval);
@@ -1439,8 +1439,9 @@ br_multicast_leave_group(struct net_bridge *br,
1439 rcu_assign_pointer(*pp, p->next); 1439 rcu_assign_pointer(*pp, p->next);
1440 hlist_del_init(&p->mglist); 1440 hlist_del_init(&p->mglist);
1441 del_timer(&p->timer); 1441 del_timer(&p->timer);
1442 br_mdb_notify(br->dev, port, group, RTM_DELMDB,
1443 p->state);
1442 call_rcu_bh(&p->rcu, br_multicast_free_pg); 1444 call_rcu_bh(&p->rcu, br_multicast_free_pg);
1443 br_mdb_notify(br->dev, port, group, RTM_DELMDB);
1444 1445
1445 if (!mp->ports && !mp->mglist && 1446 if (!mp->ports && !mp->mglist &&
1446 netif_running(br->dev)) 1447 netif_running(br->dev))
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 8b21146b24a0..c73fd785654d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -488,7 +488,7 @@ br_multicast_new_port_group(struct net_bridge_port *port, struct br_ip *group,
488void br_mdb_init(void); 488void br_mdb_init(void);
489void br_mdb_uninit(void); 489void br_mdb_uninit(void);
490void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port, 490void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
491 struct br_ip *group, int type); 491 struct br_ip *group, int type, u8 state);
492 492
493#define mlock_dereference(X, br) \ 493#define mlock_dereference(X, br) \
494 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) 494 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))