net: bridge: mdb: use mdb and port entries in notifications
We have to use mdb and port entries when sending mdb notifications in order to fill in all group attributes properly. Before this change we would've used a fake br_mdb_entry struct to fill in only partial information about the mdb. Now we can also reuse the mdb dump fill function and thus have only a single central place which fills the mdb attributes. v3: add IPv6 support Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:

committed by
Jakub Kicinski

parent
79abc87505
commit
81f1983852
@@ -188,7 +188,7 @@ void br_multicast_del_pg(struct net_bridge_mdb_entry *mp,
|
||||
del_timer(&pg->rexmit_timer);
|
||||
hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node)
|
||||
br_multicast_del_group_src(ent);
|
||||
br_mdb_notify(br->dev, pg->port, &pg->addr, RTM_DELMDB, pg->flags);
|
||||
br_mdb_notify(br->dev, mp, pg, RTM_DELMDB);
|
||||
kfree_rcu(pg, rcu);
|
||||
|
||||
if (!mp->ports && !mp->host_joined && netif_running(br->dev))
|
||||
@@ -749,8 +749,7 @@ void br_multicast_host_join(struct net_bridge_mdb_entry *mp, bool notify)
|
||||
if (!mp->host_joined) {
|
||||
mp->host_joined = true;
|
||||
if (notify)
|
||||
br_mdb_notify(mp->br->dev, NULL, &mp->addr,
|
||||
RTM_NEWMDB, 0);
|
||||
br_mdb_notify(mp->br->dev, mp, NULL, RTM_NEWMDB);
|
||||
}
|
||||
mod_timer(&mp->timer, jiffies + mp->br->multicast_membership_interval);
|
||||
}
|
||||
@@ -762,7 +761,7 @@ void br_multicast_host_leave(struct net_bridge_mdb_entry *mp, bool notify)
|
||||
|
||||
mp->host_joined = false;
|
||||
if (notify)
|
||||
br_mdb_notify(mp->br->dev, NULL, &mp->addr, RTM_DELMDB, 0);
|
||||
br_mdb_notify(mp->br->dev, mp, NULL, RTM_DELMDB);
|
||||
}
|
||||
|
||||
static int br_multicast_add_group(struct net_bridge *br,
|
||||
@@ -805,10 +804,11 @@ static int br_multicast_add_group(struct net_bridge *br,
|
||||
if (unlikely(!p))
|
||||
goto err;
|
||||
rcu_assign_pointer(*pp, p);
|
||||
br_mdb_notify(br->dev, port, group, RTM_NEWMDB, 0);
|
||||
br_mdb_notify(br->dev, mp, p, RTM_NEWMDB);
|
||||
|
||||
found:
|
||||
mod_timer(&p->timer, now + br->multicast_membership_interval);
|
||||
|
||||
out:
|
||||
err = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user