diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-04-26 08:53:00 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-04-26 08:53:00 +0200 |
commit | 6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886 (patch) | |
tree | c20f6c6aeaa71d41ebbafc2b60bd8b5e3b7f214e | |
parent | c79e6bb61f6c95e83a267dd62d0549e8c16265b9 (diff) | |
download | modquicktun-6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886.tar modquicktun-6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886.zip |
Reserve the correct amount of headroom
-rw-r--r-- | quicktun.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |