summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-04-04 00:47:38 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2015-04-06 00:11:58 +0200
commitd1ea9d86015985fd83af0edf1fc51fae275f8c4a (patch)
treeb4ac51bd31002fcf578b6d3f9d3b0e2326fba088
parent373ace16901cdfbddc04ef5ad9e2d070498c8470 (diff)
headers: add sock_skb_cb_check_size()
The bluetooth code needs this function. It was introduced in upstream commit b4772ef87. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/net/sock.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index ec67b9e2..1a0a4155 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -38,4 +38,9 @@
#define SOCK_SELECT_ERR_QUEUE (SOCK_QUEUE_SHRUNK + 14)
#endif
+#ifndef sock_skb_cb_check_size
+#define sock_skb_cb_check_size(size) \
+ BUILD_BUG_ON((size) > FIELD_SIZEOF(struct sk_buff, cb))
+#endif
+
#endif /* __BACKPORT_NET_SOCK_H */