diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-11-20 11:03:38 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-11-20 11:03:38 +0300 |
| commit | 90accd6fabf9b2fa2705945a4c601877a75d43bf (patch) | |
| tree | d393cb54f0228b1313139e4e14adf4f5cf236b59 /net/core/skbuff.c | |
| parent | b43d196c4d3fe46d6dda7c987c47792612b80b1b (diff) | |
| parent | ee2f6cc7f9ea2542ad46070ed62ba7aa04d08871 (diff) | |
| download | linux-90accd6fabf9b2fa2705945a4c601877a75d43bf.tar.xz | |
Merge branch 'linus' into x86/memory-corruption-check
Diffstat (limited to 'net/core/skbuff.c')
| -rw-r--r-- | net/core/skbuff.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 4e22e3a35359..d49ef8301b5b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -449,6 +449,18 @@ void kfree_skb(struct sk_buff *skb) __kfree_skb(skb); } +/** + * skb_recycle_check - check if skb can be reused for receive + * @skb: buffer + * @skb_size: minimum receive buffer size + * + * Checks that the skb passed in is not shared or cloned, and + * that it is linear and its head portion at least as large as + * skb_size so that it can be recycled as a receive buffer. + * If these conditions are met, this function does any necessary + * reference count dropping and cleans up the skbuff as if it + * just came from __alloc_skb(). + */ int skb_recycle_check(struct sk_buff *skb, int skb_size) { struct skb_shared_info *shinfo; @@ -474,8 +486,8 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) shinfo->frag_list = NULL; memset(skb, 0, offsetof(struct sk_buff, tail)); - skb_reset_tail_pointer(skb); skb->data = skb->head + NET_SKB_PAD; + skb_reset_tail_pointer(skb); return 1; } |
