Skip to content

Commit

Permalink
[IPSEC]: COW skb header in UDP decap
Browse files Browse the repository at this point in the history
The following patch just makes the header part of the skb writeable.
This is needed since we modify the IP headers just a few lines below.

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 Apr 20, 2005
1 parent c7f905f commit 4d78b6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,8 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
* header and optional ESP marker bytes) and then modify the
* protocol to ESP, and then call into the transform receiver.
*/
if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
return 0;

/* Now we can update and verify the packet length... */
iph = skb->nh.iph;
Expand Down

0 comments on commit 4d78b6c

Please sign in to comment.