From 812fe74ecd3e26e9a74198d9fa73bb036ced9670 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Thu, 14 Mar 2013 05:40:32 +0000 Subject: [PATCH] --- yaml --- r: 361443 b: refs/heads/master c: 16fad69cfe4adbbfa813de516757b87bcae36d93 h: refs/heads/master i: 361441: 6f21c76dc80a0a583a58e2d3bdb367ebb86a670b 361439: 4ca88eb86130fb1aeea22d54d3d6b31e6358d581 v: v3 --- [refs] | 2 +- trunk/include/linux/skbuff.h | 7 +++++-- trunk/net/ipv4/tcp.c | 2 +- trunk/net/ipv4/tcp_output.c | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 027a4774dab9..61cc5d4e4afb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b701f16dd490d3f346724050f17d60beda094998 +refs/heads/master: 16fad69cfe4adbbfa813de516757b87bcae36d93 diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index 821c7f45d2a7..6f2bb860e051 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -500,7 +500,7 @@ struct sk_buff { union { __u32 mark; __u32 dropcount; - __u32 avail_size; + __u32 reserved_tailroom; }; sk_buff_data_t inner_transport_header; @@ -1447,7 +1447,10 @@ static inline int skb_tailroom(const struct sk_buff *skb) */ static inline int skb_availroom(const struct sk_buff *skb) { - return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len; + if (skb_is_nonlinear(skb)) + return 0; + + return skb->end - skb->tail - skb->reserved_tailroom; } /** diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index 47e854fcae24..e22020790709 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -775,7 +775,7 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp) * Make sure that we have exactly size bytes * available to the caller, no more, no less. */ - skb->avail_size = size; + skb->reserved_tailroom = skb->end - skb->tail - size; return skb; } __kfree_skb(skb); diff --git a/trunk/net/ipv4/tcp_output.c b/trunk/net/ipv4/tcp_output.c index e2b4461074da..817fbb396bc8 100644 --- a/trunk/net/ipv4/tcp_output.c +++ b/trunk/net/ipv4/tcp_output.c @@ -1298,7 +1298,6 @@ static void __pskb_trim_head(struct sk_buff *skb, int len) eat = min_t(int, len, skb_headlen(skb)); if (eat) { __skb_pull(skb, eat); - skb->avail_size -= eat; len -= eat; if (!len) return;