aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_multicast.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2010-04-25 04:06:40 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-26 14:26:58 -0400
commit1fafc7a9353ef68e1b8d4bb130cb6402cf7dfd5a (patch)
tree5e75cffd4a8ff91cd3f73d39db70ad784cf36565 /net/bridge/br_multicast.c
parent4a4771a58e13b46bfdc999fe481e550f8c6937ff (diff)
bridge br_multicast: Ensure to initialize BR_INPUT_SKB_CB(skb)->mrouters_only.
Even with commit 32dec5dd0233ebffa9cae25ce7ba6daeb7df4467 ("bridge br_multicast: Don't refer to BR_INPUT_SKB_CB(skb)->mrouters_only without IGMP snooping."), BR_INPUT_SKB_CB(skb)->mrouters_only is not appropriately initialized if IGMP/MLD snooping support is compiled and disabled, so we can see garbage. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_multicast.c')
-rw-r--r--net/bridge/br_multicast.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 38d1fbde5fb8..e481dbd19495 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1340,9 +1340,6 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1340 unsigned offset; 1340 unsigned offset;
1341 int err; 1341 int err;
1342 1342
1343 BR_INPUT_SKB_CB(skb)->igmp = 0;
1344 BR_INPUT_SKB_CB(skb)->mrouters_only = 0;
1345
1346 /* We treat OOM as packet loss for now. */ 1343 /* We treat OOM as packet loss for now. */
1347 if (!pskb_may_pull(skb, sizeof(*iph))) 1344 if (!pskb_may_pull(skb, sizeof(*iph)))
1348 return -EINVAL; 1345 return -EINVAL;
@@ -1440,9 +1437,6 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
1440 unsigned offset; 1437 unsigned offset;
1441 int err; 1438 int err;
1442 1439
1443 BR_INPUT_SKB_CB(skb)->igmp = 0;
1444 BR_INPUT_SKB_CB(skb)->mrouters_only = 0;
1445
1446 if (!pskb_may_pull(skb, sizeof(*ip6h))) 1440 if (!pskb_may_pull(skb, sizeof(*ip6h)))
1447 return -EINVAL; 1441 return -EINVAL;
1448 1442
@@ -1550,6 +1544,9 @@ out:
1550int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port, 1544int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port,
1551 struct sk_buff *skb) 1545 struct sk_buff *skb)
1552{ 1546{
1547 BR_INPUT_SKB_CB(skb)->igmp = 0;
1548 BR_INPUT_SKB_CB(skb)->mrouters_only = 0;
1549
1553 if (br->multicast_disabled) 1550 if (br->multicast_disabled)
1554 return 0; 1551 return 0;
1555 1552