summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-04-26 08:53:00 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-04-26 08:53:00 +0200
commit6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886 (patch)
treec20f6c6aeaa71d41ebbafc2b60bd8b5e3b7f214e
parentc79e6bb61f6c95e83a267dd62d0549e8c16265b9 (diff)
downloadmodquicktun-6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886.tar
modquicktun-6162ae09c6a0f62eb687e3b6ddd9ab65e7cb0886.zip
Reserve the correct amount of headroom
-rw-r--r--quicktun.c5
1 files 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;