[IPSEC]: COW skb header in UDP decap
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 20 Apr 2005 05:48:59 +0000 (22:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Apr 2005 05:48:59 +0000 (22:48 -0700)
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>
net/ipv4/udp.c

index 6baddfbedca3f90adaef9f22e2e97d889cbdc945..8a213238f2873e8a985bf1c85b1f8f347d8f7d8c 100644 (file)
@@ -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;