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>
This commit is contained in:
Eyal Birger 2015-03-01 14:58:30 +02:00 committed by David S. Miller
commit 3bc3b96f3b
3 changed files with 8 additions and 2 deletions

View file

@ -2081,6 +2081,12 @@ static inline int sock_intr_errno(long timeo)
#define sock_skb_cb_check_size(size) \
BUILD_BUG_ON((size) > FIELD_SIZEOF(struct sk_buff, cb))
static inline void
sock_skb_set_dropcount(const struct sock *sk, struct sk_buff *skb)
{
skb->dropcount = atomic_read(&sk->sk_drops);
}
void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
struct sk_buff *skb);
void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,