Commit ac3208fb authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 5cacb2c7 d1942cd4
...@@ -866,7 +866,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, ...@@ -866,7 +866,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
unsigned long now = jiffies; unsigned long now = jiffies;
unsigned char flags = 0; unsigned char flags = 0;
u8 filter_mode; u8 filter_mode;
int err;
__mdb_entry_to_br_ip(entry, &group, mdb_attrs); __mdb_entry_to_br_ip(entry, &group, mdb_attrs);
...@@ -892,13 +891,9 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, ...@@ -892,13 +891,9 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
return -EINVAL; return -EINVAL;
} }
mp = br_mdb_ip_get(br, &group); mp = br_multicast_new_group(br, &group);
if (!mp) { if (IS_ERR(mp))
mp = br_multicast_new_group(br, &group); return PTR_ERR(mp);
err = PTR_ERR_OR_ZERO(mp);
if (err)
return err;
}
/* host join */ /* host join */
if (!port) { if (!port) {
......
...@@ -2669,7 +2669,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx, ...@@ -2669,7 +2669,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx,
if (!pmctx || igmpv2) if (!pmctx || igmpv2)
continue; continue;
spin_lock_bh(&brmctx->br->multicast_lock); spin_lock(&brmctx->br->multicast_lock);
if (!br_multicast_ctx_should_use(brmctx, pmctx)) if (!br_multicast_ctx_should_use(brmctx, pmctx))
goto unlock_continue; goto unlock_continue;
...@@ -2717,7 +2717,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx, ...@@ -2717,7 +2717,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx,
if (changed) if (changed)
br_mdb_notify(brmctx->br->dev, mdst, pg, RTM_NEWMDB); br_mdb_notify(brmctx->br->dev, mdst, pg, RTM_NEWMDB);
unlock_continue: unlock_continue:
spin_unlock_bh(&brmctx->br->multicast_lock); spin_unlock(&brmctx->br->multicast_lock);
} }
return err; return err;
...@@ -2807,7 +2807,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx, ...@@ -2807,7 +2807,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx,
if (!pmctx || mldv1) if (!pmctx || mldv1)
continue; continue;
spin_lock_bh(&brmctx->br->multicast_lock); spin_lock(&brmctx->br->multicast_lock);
if (!br_multicast_ctx_should_use(brmctx, pmctx)) if (!br_multicast_ctx_should_use(brmctx, pmctx))
goto unlock_continue; goto unlock_continue;
...@@ -2859,7 +2859,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx, ...@@ -2859,7 +2859,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx,
if (changed) if (changed)
br_mdb_notify(brmctx->br->dev, mdst, pg, RTM_NEWMDB); br_mdb_notify(brmctx->br->dev, mdst, pg, RTM_NEWMDB);
unlock_continue: unlock_continue:
spin_unlock_bh(&brmctx->br->multicast_lock); spin_unlock(&brmctx->br->multicast_lock);
} }
return err; return err;
......
...@@ -96,9 +96,6 @@ cleanup() ...@@ -96,9 +96,6 @@ cleanup()
switch_destroy switch_destroy
# Always cleanup the mcast group
ip address del dev $h2 $TEST_GROUP/32 2>&1 1>/dev/null
h2_destroy h2_destroy
h1_destroy h1_destroy
......
...@@ -59,6 +59,9 @@ switch_create() ...@@ -59,6 +59,9 @@ switch_create()
switch_destroy() switch_destroy()
{ {
tc qdisc del dev $swp2 clsact
tc qdisc del dev $swp1 clsact
ip link set dev $swp2 down ip link set dev $swp2 down
ip link set dev $swp1 down ip link set dev $swp1 down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment