diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-02-14 04:44:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-15 15:10:37 -0500 |
commit | 14bbd6a565e1bcdc240d44687edb93f721cfdf99 (patch) | |
tree | b2001bb985856d2177212451273d1f6ebcc55035 /net/ipv4 | |
parent | d887199dc28c46788b155b234274d5ff41afed8e (diff) |
net: Add skb_unclone() helper function.
This function will be used in next GRE_GSO patch. This patch does
not change any functionality.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ah4.c | 3 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_mode_tunnel.c | 3 |
5 files changed, 5 insertions, 7 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index a69b4e4a02b5..2e7f1948216f 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -321,8 +321,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) | |||
321 | 321 | ||
322 | /* We are going to _remove_ AH header to keep sockets happy, | 322 | /* We are going to _remove_ AH header to keep sockets happy, |
323 | * so... Later this can change. */ | 323 | * so... Later this can change. */ |
324 | if (skb_cloned(skb) && | 324 | if (skb_unclone(skb, GFP_ATOMIC)) |
325 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | ||
326 | goto out; | 325 | goto out; |
327 | 326 | ||
328 | skb->ip_summed = CHECKSUM_NONE; | 327 | skb->ip_summed = CHECKSUM_NONE; |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 1211613c6c34..b6d30acb600c 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -590,7 +590,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, | |||
590 | goto out_oversize; | 590 | goto out_oversize; |
591 | 591 | ||
592 | /* Head of list must not be cloned. */ | 592 | /* Head of list must not be cloned. */ |
593 | if (skb_cloned(head) && pskb_expand_head(head, 0, 0, GFP_ATOMIC)) | 593 | if (skb_unclone(head, GFP_ATOMIC)) |
594 | goto out_nomem; | 594 | goto out_nomem; |
595 | 595 | ||
596 | /* If the first fragment is fragmented itself, we split | 596 | /* If the first fragment is fragmented itself, we split |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 6182d90e97b0..fd0cea114b5d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1331,7 +1331,7 @@ static void __pskb_trim_head(struct sk_buff *skb, int len) | |||
1331 | /* Remove acked data from a packet in the transmit queue. */ | 1331 | /* Remove acked data from a packet in the transmit queue. */ |
1332 | int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | 1332 | int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) |
1333 | { | 1333 | { |
1334 | if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 1334 | if (skb_unclone(skb, GFP_ATOMIC)) |
1335 | return -ENOMEM; | 1335 | return -ENOMEM; |
1336 | 1336 | ||
1337 | __pskb_trim_head(skb, len); | 1337 | __pskb_trim_head(skb, len); |
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c index 06814b6216dc..1f12c8b45864 100644 --- a/net/ipv4/xfrm4_input.c +++ b/net/ipv4/xfrm4_input.c | |||
@@ -132,7 +132,7 @@ int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb) | |||
132 | * header and optional ESP marker bytes) and then modify the | 132 | * header and optional ESP marker bytes) and then modify the |
133 | * protocol to ESP, and then call into the transform receiver. | 133 | * protocol to ESP, and then call into the transform receiver. |
134 | */ | 134 | */ |
135 | if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 135 | if (skb_unclone(skb, GFP_ATOMIC)) |
136 | goto drop; | 136 | goto drop; |
137 | 137 | ||
138 | /* Now we can update and verify the packet length... */ | 138 | /* Now we can update and verify the packet length... */ |
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c index ddee0a099a2c..1162ace30838 100644 --- a/net/ipv4/xfrm4_mode_tunnel.c +++ b/net/ipv4/xfrm4_mode_tunnel.c | |||
@@ -142,8 +142,7 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) | |||
142 | for_each_input_rcu(rcv_notify_handlers, handler) | 142 | for_each_input_rcu(rcv_notify_handlers, handler) |
143 | handler->handler(skb); | 143 | handler->handler(skb); |
144 | 144 | ||
145 | if (skb_cloned(skb) && | 145 | if (err = skb_unclone(skb, GFP_ATOMIC)) |
146 | (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) | ||
147 | goto out; | 146 | goto out; |
148 | 147 | ||
149 | if (x->props.flags & XFRM_STATE_DECAP_DSCP) | 148 | if (x->props.flags & XFRM_STATE_DECAP_DSCP) |