diff options
author | David S. Miller <davem@davemloft.net> | 2010-05-31 00:10:35 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-31 00:10:35 -0700 |
commit | 92b4522f72916ff2675060e29e4b24cf26ab59ce (patch) | |
tree | 8424a1c550a98ce09f127425fde9b7b5f2f5027a /net/core | |
parent | 67a3e12b05e055c0415c556a315a3d3eb637e29e (diff) | |
parent | 2903037400a26e7c0cc93ab75a7d62abfacdf485 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index f8abf68e398..4e7ac09c281 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -482,22 +482,22 @@ EXPORT_SYMBOL(consume_skb); * 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) +bool skb_recycle_check(struct sk_buff *skb, int skb_size) { struct skb_shared_info *shinfo; if (irqs_disabled()) - return 0; + return false; if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) - return 0; + return false; skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); if (skb_end_pointer(skb) - skb->head < skb_size) - return 0; + return false; if (skb_shared(skb) || skb_cloned(skb)) - return 0; + return false; skb_release_head_state(skb); @@ -509,7 +509,7 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) skb->data = skb->head + NET_SKB_PAD; skb_reset_tail_pointer(skb); - return 1; + return true; } EXPORT_SYMBOL(skb_recycle_check); @@ -2996,7 +2996,11 @@ void skb_tstamp_tx(struct sk_buff *orig_skb, memset(serr, 0, sizeof(*serr)); serr->ee.ee_errno = ENOMSG; serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING; + + bh_lock_sock(sk); err = sock_queue_err_skb(sk, skb); + bh_unlock_sock(sk); + if (err) kfree_skb(skb); } |