Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223768
b: refs/heads/master
c: 9d89081
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Winkler authored and David S. Miller committed Jan 3, 2011
1 parent 58a0aab commit 4320f2d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f32c867219734b06abc980d4812f67b6d6fe517
refs/heads/master: 9d89081d698132b5f964aea88112f76492563ee9
28 changes: 18 additions & 10 deletions trunk/net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
struct net_bridge_port *port,
struct sk_buff *skb)
{
struct sk_buff *skb2 = skb;
struct sk_buff *skb2;
struct ipv6hdr *ip6h;
struct icmp6hdr *icmp6h;
u8 nexthdr;
Expand Down Expand Up @@ -1469,15 +1469,15 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
if (!skb2)
return -ENOMEM;

err = -EINVAL;
if (!pskb_may_pull(skb2, offset + sizeof(struct icmp6hdr)))
goto out;

len -= offset - skb_network_offset(skb2);

__skb_pull(skb2, offset);
skb_reset_transport_header(skb2);

err = -EINVAL;
if (!pskb_may_pull(skb2, sizeof(*icmp6h)))
goto out;

icmp6h = icmp6_hdr(skb2);

switch (icmp6h->icmp6_type) {
Expand Down Expand Up @@ -1516,7 +1516,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
switch (icmp6h->icmp6_type) {
case ICMPV6_MGM_REPORT:
{
struct mld_msg *mld = (struct mld_msg *)icmp6h;
struct mld_msg *mld;
if (!pskb_may_pull(skb2, sizeof(*mld))) {
err = -EINVAL;
goto out;
}
mld = (struct mld_msg *)skb_transport_header(skb2);
BR_INPUT_SKB_CB(skb2)->mrouters_only = 1;
err = br_ip6_multicast_add_group(br, port, &mld->mld_mca);
break;
Expand All @@ -1529,15 +1534,18 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
break;
case ICMPV6_MGM_REDUCTION:
{
struct mld_msg *mld = (struct mld_msg *)icmp6h;
struct mld_msg *mld;
if (!pskb_may_pull(skb2, sizeof(*mld))) {
err = -EINVAL;
goto out;
}
mld = (struct mld_msg *)skb_transport_header(skb2);
br_ip6_multicast_leave_group(br, port, &mld->mld_mca);
}
}

out:
__skb_push(skb2, offset);
if (skb2 != skb)
kfree_skb(skb2);
kfree_skb(skb2);
return err;
}
#endif
Expand Down

0 comments on commit 4320f2d

Please sign in to comment.