summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEyal Birger <eyal.birger@gmail.com>2015-03-01 14:58:29 +0200
committerDavid S. Miller <davem@davemloft.net>2015-03-02 00:19:30 -0500
commitb4772ef879a8f7d8c56118c2ae5a296fcf6f81d2 (patch)
treeb4498c776c28e5c87cdeebf17577d002bcd21d47 /include
parent2472d7613bd3bae40a7dc75539c0858d5b9e795a (diff)
net: use common macro for assering skb->cb[] available size in protocol families
As part of an effort to move skb->dropcount to skb->cb[] use a common macro in protocol families using skb->cb[] for ancillary data to validate available room in skb->cb[]. Signed-off-by: Eyal Birger <eyal.birger@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index ab186b1d31ff..a2502d248641 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2078,6 +2078,9 @@ static inline int sock_intr_errno(long timeo)
return timeo == MAX_SCHEDULE_TIMEOUT ? -ERESTARTSYS : -EINTR;
}
+#define sock_skb_cb_check_size(size) \
+ BUILD_BUG_ON((size) > FIELD_SIZEOF(struct sk_buff, cb))
+
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,