diff options
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 88c613eab142..8e4ac97c8477 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -3621,13 +3621,14 @@ struct sk_buff *sock_dequeue_err_skb(struct sock *sk) | |||
3621 | { | 3621 | { |
3622 | struct sk_buff_head *q = &sk->sk_error_queue; | 3622 | struct sk_buff_head *q = &sk->sk_error_queue; |
3623 | struct sk_buff *skb, *skb_next; | 3623 | struct sk_buff *skb, *skb_next; |
3624 | unsigned long flags; | ||
3624 | int err = 0; | 3625 | int err = 0; |
3625 | 3626 | ||
3626 | spin_lock_bh(&q->lock); | 3627 | spin_lock_irqsave(&q->lock, flags); |
3627 | skb = __skb_dequeue(q); | 3628 | skb = __skb_dequeue(q); |
3628 | if (skb && (skb_next = skb_peek(q))) | 3629 | if (skb && (skb_next = skb_peek(q))) |
3629 | err = SKB_EXT_ERR(skb_next)->ee.ee_errno; | 3630 | err = SKB_EXT_ERR(skb_next)->ee.ee_errno; |
3630 | spin_unlock_bh(&q->lock); | 3631 | spin_unlock_irqrestore(&q->lock, flags); |
3631 | 3632 | ||
3632 | sk->sk_err = err; | 3633 | sk->sk_err = err; |
3633 | if (err) | 3634 | if (err) |
@@ -3732,9 +3733,13 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb, | |||
3732 | struct sock *sk, int tstype) | 3733 | struct sock *sk, int tstype) |
3733 | { | 3734 | { |
3734 | struct sk_buff *skb; | 3735 | struct sk_buff *skb; |
3735 | bool tsonly = sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TSONLY; | 3736 | bool tsonly; |
3737 | |||
3738 | if (!sk) | ||
3739 | return; | ||
3736 | 3740 | ||
3737 | if (!sk || !skb_may_tx_timestamp(sk, tsonly)) | 3741 | tsonly = sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TSONLY; |
3742 | if (!skb_may_tx_timestamp(sk, tsonly)) | ||
3738 | return; | 3743 | return; |
3739 | 3744 | ||
3740 | if (tsonly) | 3745 | if (tsonly) |
@@ -4172,7 +4177,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) | |||
4172 | skb->ignore_df = 0; | 4177 | skb->ignore_df = 0; |
4173 | skb_dst_drop(skb); | 4178 | skb_dst_drop(skb); |
4174 | skb->mark = 0; | 4179 | skb->mark = 0; |
4175 | skb->sender_cpu = 0; | 4180 | skb_sender_cpu_clear(skb); |
4176 | skb_init_secmark(skb); | 4181 | skb_init_secmark(skb); |
4177 | secpath_reset(skb); | 4182 | secpath_reset(skb); |
4178 | nf_reset(skb); | 4183 | nf_reset(skb); |