Skip to content

Commit 58d913a

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
net: bridge: multicast: add context support for host-joined groups
Adding bridge multicast context support for host-joined groups is easy because we only need the proper timer value. We pass the already chosen context and use its timer value. Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6567cb4 commit 58d913a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

net/bridge/br_mdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
11051105
return -EEXIST;
11061106
}
11071107

1108-
br_multicast_host_join(mp, false);
1108+
br_multicast_host_join(brmctx, mp, false);
11091109
br_mdb_notify(br->dev, mp, NULL, RTM_NEWMDB);
11101110

11111111
return 0;

net/bridge/br_multicast.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,8 @@ struct net_bridge_port_group *br_multicast_new_port_group(
13121312
return p;
13131313
}
13141314

1315-
void br_multicast_host_join(struct net_bridge_mdb_entry *mp, bool notify)
1315+
void br_multicast_host_join(const struct net_bridge_mcast *brmctx,
1316+
struct net_bridge_mdb_entry *mp, bool notify)
13161317
{
13171318
if (!mp->host_joined) {
13181319
mp->host_joined = true;
@@ -1325,8 +1326,7 @@ void br_multicast_host_join(struct net_bridge_mdb_entry *mp, bool notify)
13251326
if (br_group_is_l2(&mp->addr))
13261327
return;
13271328

1328-
mod_timer(&mp->timer,
1329-
jiffies + mp->br->multicast_ctx.multicast_membership_interval);
1329+
mod_timer(&mp->timer, jiffies + brmctx->multicast_membership_interval);
13301330
}
13311331

13321332
void br_multicast_host_leave(struct net_bridge_mdb_entry *mp, bool notify)
@@ -1363,7 +1363,7 @@ __br_multicast_add_group(struct net_bridge_mcast *brmctx,
13631363
return ERR_CAST(mp);
13641364

13651365
if (!pmctx) {
1366-
br_multicast_host_join(mp, true);
1366+
br_multicast_host_join(brmctx, mp, true);
13671367
goto out;
13681368
}
13691369

net/bridge/br_private.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,8 @@ void br_multicast_get_stats(const struct net_bridge *br,
887887
struct br_mcast_stats *dest);
888888
void br_mdb_init(void);
889889
void br_mdb_uninit(void);
890-
void br_multicast_host_join(struct net_bridge_mdb_entry *mp, bool notify);
890+
void br_multicast_host_join(const struct net_bridge_mcast *brmctx,
891+
struct net_bridge_mdb_entry *mp, bool notify);
891892
void br_multicast_host_leave(struct net_bridge_mdb_entry *mp, bool notify);
892893
void br_multicast_star_g_handle_mode(struct net_bridge_port_group *pg,
893894
u8 filter_mode);

0 commit comments

Comments
 (0)