From 6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 26 Apr 2011 08:53:00 +0200 Subject: Reserve the correct amount of headroom --- quicktun.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quicktun.c b/quicktun.c index 2887942..f57e480 100644 --- a/quicktun.c +++ b/quicktun.c @@ -87,8 +87,9 @@ static netdev_tx_t quicktun_net_xmit(struct sk_buff *skb, struct net_device *dev goto error; } - if (skb_headroom(skb) < (LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) + sizeof(struct udphdr)) || skb_shared(skb) || (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { - struct sk_buff *new_skb = skb_realloc_headroom(skb, sizeof(struct iphdr) + sizeof(struct udphdr)); + if (skb_headroom(skb) < (LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) + sizeof(struct udphdr)) + || skb_shared(skb) || (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { + struct sk_buff *new_skb = skb_realloc_headroom(skb, LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) + sizeof(struct udphdr)); if (!new_skb) { tun->dev->stats.tx_dropped++; goto error; -- cgit v1.2.3