diff options
author | Eyal Birger <eyal.birger@gmail.com> | 2015-03-01 14:58:30 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-02 00:19:30 -0500 |
commit | 3bc3b96f3b455bd14a8ccd83ffffc85625aba641 (patch) | |
tree | ed9f7a38da7dd0d579f3ca55591842b29aa857ad /net | |
parent | b4772ef879a8f7d8c56118c2ae5a296fcf6f81d2 (diff) | |
download | linux-3bc3b96f3b455bd14a8ccd83ffffc85625aba641.tar.gz linux-3bc3b96f3b455bd14a8ccd83ffffc85625aba641.tar.bz2 linux-3bc3b96f3b455bd14a8ccd83ffffc85625aba641.zip |
net: add common accessor for setting dropcount on packets
As part of an effort to move skb->dropcount to skb->cb[], use
a common function in order to set dropcount in struct sk_buff.
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/sock.c | 2 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 93c8b20c91e4..9c74fc8f0e32 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -466,7 +466,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) skb_dst_force(skb); spin_lock_irqsave(&list->lock, flags); - skb->dropcount = atomic_read(&sk->sk_drops); + sock_skb_set_dropcount(sk, skb); __skb_queue_tail(list, skb); spin_unlock_irqrestore(&list->lock, flags); diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 9cdb414cd231..9db83693d736 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1845,7 +1845,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, spin_lock(&sk->sk_receive_queue.lock); po->stats.stats1.tp_packets++; - skb->dropcount = atomic_read(&sk->sk_drops); + sock_skb_set_dropcount(sk, skb); __skb_queue_tail(&sk->sk_receive_queue, skb); spin_unlock(&sk->sk_receive_queue.lock); sk->sk_data_ready(sk); |