backports: add __sockaddr_check_size()
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 24 Jan 2014 18:10:59 +0000 (19:10 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 24 Jan 2014 20:25:47 +0000 (21:25 +0100)
This is used by net/bluetooth/l2cap_sock.c

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/socket.h

index 4187af231295661e02fac0b6948b63e4364635df..8b6453ec141789ec84cbd2e58e077db67d7ba95a 100644 (file)
@@ -10,4 +10,9 @@
 #define SOL_NFC                280
 #endif
 
+#ifndef __sockaddr_check_size
+#define __sockaddr_check_size(size)    \
+       BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
+#endif
+
 #endif /* __BACKPORT_SOCKET_H */