Skip to content

Commit

Permalink
[ICMP]: Restore pskb_pull calls in receive function
Browse files Browse the repository at this point in the history
Somewhere along the development of my ICMP relookup patch the header
length check went AWOL on the non-IPsec path.  This patch restores the
check.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Feb 5, 2008
1 parent 5d8c0aa commit 8cf2294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,8 @@ int icmp_rcv(struct sk_buff *skb)
goto error;
}

__skb_pull(skb, sizeof(*icmph));
if (!pskb_pull(skb, sizeof(*icmph)))
goto error;

icmph = icmp_hdr(skb);

Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ static int icmpv6_rcv(struct sk_buff *skb)
}
}

__skb_pull(skb, sizeof(*hdr));
if (!pskb_pull(skb, sizeof(*hdr)))
goto discard_it;

hdr = icmp6_hdr(skb);

Expand Down

0 comments on commit 8cf2294

Please sign in to comment.