summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEyal Birger <eyal.birger@gmail.com>2015-03-01 14:58:30 +0200
committerDavid S. Miller <davem@davemloft.net>2015-03-02 00:19:30 -0500
commit3bc3b96f3b455bd14a8ccd83ffffc85625aba641 (patch)
treeed9f7a38da7dd0d579f3ca55591842b29aa857ad /include/net
parentb4772ef879a8f7d8c56118c2ae5a296fcf6f81d2 (diff)
downloadtalos-op-linux-3bc3b96f3b455bd14a8ccd83ffffc85625aba641.tar.gz
talos-op-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 'include/net')
-rw-r--r--include/net/sock.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index a2502d248641..0996fe451e5f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -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,
OpenPOWER on IntegriCloud