Skip to content

Commit

Permalink
bridge: Pseudo-header required for the checksum of ICMPv6
Browse files Browse the repository at this point in the history
Checksum of ICMPv6 is not properly computed because the pseudo header is not used.
Thus, the MLD packet gets dropped by the bridge.

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
Reported-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yan, Zheng authored and David S. Miller committed Aug 25, 2011
1 parent e05c4ad commit 4b275d7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,16 +1520,23 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
err = pskb_trim_rcsum(skb2, len);
if (err)
goto out;
err = -EINVAL;
}

ip6h = ipv6_hdr(skb2);

switch (skb2->ip_summed) {
case CHECKSUM_COMPLETE:
if (!csum_fold(skb2->csum))
if (!csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, skb2->len,
IPPROTO_ICMPV6, skb2->csum))
break;
/*FALLTHROUGH*/
case CHECKSUM_NONE:
skb2->csum = 0;
if (skb_checksum_complete(skb2))
skb2->csum = ~csum_unfold(csum_ipv6_magic(&ip6h->saddr,
&ip6h->daddr,
skb2->len,
IPPROTO_ICMPV6, 0));
if (__skb_checksum_complete(skb2))
goto out;
}

Expand Down

0 comments on commit 4b275d7

Please sign in to comment.