Skip to content

Commit ac3208f

Browse files
committed
Merge branch 'net-bridge-mc-cleanups'
Ido Schimmel says: ==================== bridge: A few multicast cleanups Clean up a few issues spotted while working on the bridge multicast code and running its selftests. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5cacb2c + d1942cd commit ac3208f

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

net/bridge/br_mdb.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
866866
unsigned long now = jiffies;
867867
unsigned char flags = 0;
868868
u8 filter_mode;
869-
int err;
870869

871870
__mdb_entry_to_br_ip(entry, &group, mdb_attrs);
872871

@@ -892,13 +891,9 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
892891
return -EINVAL;
893892
}
894893

895-
mp = br_mdb_ip_get(br, &group);
896-
if (!mp) {
897-
mp = br_multicast_new_group(br, &group);
898-
err = PTR_ERR_OR_ZERO(mp);
899-
if (err)
900-
return err;
901-
}
894+
mp = br_multicast_new_group(br, &group);
895+
if (IS_ERR(mp))
896+
return PTR_ERR(mp);
902897

903898
/* host join */
904899
if (!port) {

net/bridge/br_multicast.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,7 +2669,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx,
26692669
if (!pmctx || igmpv2)
26702670
continue;
26712671

2672-
spin_lock_bh(&brmctx->br->multicast_lock);
2672+
spin_lock(&brmctx->br->multicast_lock);
26732673
if (!br_multicast_ctx_should_use(brmctx, pmctx))
26742674
goto unlock_continue;
26752675

@@ -2717,7 +2717,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx,
27172717
if (changed)
27182718
br_mdb_notify(brmctx->br->dev, mdst, pg, RTM_NEWMDB);
27192719
unlock_continue:
2720-
spin_unlock_bh(&brmctx->br->multicast_lock);
2720+
spin_unlock(&brmctx->br->multicast_lock);
27212721
}
27222722

27232723
return err;
@@ -2807,7 +2807,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx,
28072807
if (!pmctx || mldv1)
28082808
continue;
28092809

2810-
spin_lock_bh(&brmctx->br->multicast_lock);
2810+
spin_lock(&brmctx->br->multicast_lock);
28112811
if (!br_multicast_ctx_should_use(brmctx, pmctx))
28122812
goto unlock_continue;
28132813

@@ -2859,7 +2859,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx,
28592859
if (changed)
28602860
br_mdb_notify(brmctx->br->dev, mdst, pg, RTM_NEWMDB);
28612861
unlock_continue:
2862-
spin_unlock_bh(&brmctx->br->multicast_lock);
2862+
spin_unlock(&brmctx->br->multicast_lock);
28632863
}
28642864

28652865
return err;

tools/testing/selftests/net/forwarding/bridge_igmp.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ cleanup()
9696

9797
switch_destroy
9898

99-
# Always cleanup the mcast group
100-
ip address del dev $h2 $TEST_GROUP/32 2>&1 1>/dev/null
101-
10299
h2_destroy
103100
h1_destroy
104101

tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ switch_create()
5959

6060
switch_destroy()
6161
{
62+
tc qdisc del dev $swp2 clsact
63+
tc qdisc del dev $swp1 clsact
64+
6265
ip link set dev $swp2 down
6366
ip link set dev $swp1 down
6467

0 commit comments

Comments
 (0)