diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-10 00:33:40 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 07:19:05 +0200 |
commit | cfbba49d80be6cf8d3872b66fc5421f119843b36 (patch) | |
tree | 2e2a966d43b6cd80c2ae7c8d5e37ab4c8a0262ad /net/ipv4/ipip.c | |
parent | [IPV4]: Make ip_tos2prio const. (diff) | |
download | linux-cfbba49d80be6cf8d3872b66fc5421f119843b36.tar.xz linux-cfbba49d80be6cf8d3872b66fc5421f119843b36.zip |
[NET]: Avoid copying writable clones in tunnel drivers
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index ebd2f2d532f6..396437242a1b 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -595,7 +595,8 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) */ max_headroom = (LL_RESERVED_SPACE(tdev)+sizeof(struct iphdr)); - if (skb_headroom(skb) < max_headroom || skb_cloned(skb) || skb_shared(skb)) { + if (skb_headroom(skb) < max_headroom || skb_shared(skb) || + (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); if (!new_skb) { ip_rt_put(rt); |