Skip to content

Commit

Permalink
[IPV6]: Fix raw socket hardware checksum failures
Browse files Browse the repository at this point in the history
When packets hit raw sockets the csum update isn't done yet, do it manually.
Packets can also reach rawv6_rcv on the output path through
ip6_call_ra_chain, in this case skb->ip_summed is CHECKSUM_NONE and this
codepath isn't executed.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Aug 17, 2005
1 parent 2ad5649 commit 97077c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)

if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
if (skb->ip_summed == CHECKSUM_HW) {
skb_postpull_rcsum(skb, skb->nh.raw,
skb->h.raw - skb->nh.raw);
skb->ip_summed = CHECKSUM_UNNECESSARY;
if (csum_ipv6_magic(&skb->nh.ipv6h->saddr,
&skb->nh.ipv6h->daddr,
Expand Down

0 comments on commit 97077c4

Please sign in to comment.