diff options
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index f87ed4803c11..bf3a2954cd4d 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -627,15 +627,14 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, | |||
627 | 627 | ||
628 | spin_lock(&sk->sk_receive_queue.lock); | 628 | spin_lock(&sk->sk_receive_queue.lock); |
629 | po->stats.tp_packets++; | 629 | po->stats.tp_packets++; |
630 | skb->dropcount = atomic_read(&sk->sk_drops); | ||
630 | __skb_queue_tail(&sk->sk_receive_queue, skb); | 631 | __skb_queue_tail(&sk->sk_receive_queue, skb); |
631 | spin_unlock(&sk->sk_receive_queue.lock); | 632 | spin_unlock(&sk->sk_receive_queue.lock); |
632 | sk->sk_data_ready(sk, skb->len); | 633 | sk->sk_data_ready(sk, skb->len); |
633 | return 0; | 634 | return 0; |
634 | 635 | ||
635 | drop_n_acct: | 636 | drop_n_acct: |
636 | spin_lock(&sk->sk_receive_queue.lock); | 637 | po->stats.tp_drops = atomic_inc_return(&sk->sk_drops); |
637 | po->stats.tp_drops++; | ||
638 | spin_unlock(&sk->sk_receive_queue.lock); | ||
639 | 638 | ||
640 | drop_n_restore: | 639 | drop_n_restore: |
641 | if (skb_head != skb->data && skb_shared(skb)) { | 640 | if (skb_head != skb->data && skb_shared(skb)) { |
@@ -1478,7 +1477,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1478 | if (err) | 1477 | if (err) |
1479 | goto out_free; | 1478 | goto out_free; |
1480 | 1479 | ||
1481 | sock_recv_timestamp(msg, sk, skb); | 1480 | sock_recv_ts_and_drops(msg, sk, skb); |
1482 | 1481 | ||
1483 | if (msg->msg_name) | 1482 | if (msg->msg_name) |
1484 | memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, | 1483 | memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, |