From: Hauke Mehrtens Date: Fri, 24 Jan 2014 18:10:59 +0000 (+0100) Subject: backports: add __sockaddr_check_size() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=da4800de7ee613026c4a074bbfe98186ec05b315;p=openwrt%2Fstaging%2Fblogic.git backports: add __sockaddr_check_size() This is used by net/bluetooth/l2cap_sock.c Signed-off-by: Hauke Mehrtens --- diff --git a/backport/backport-include/linux/socket.h b/backport/backport-include/linux/socket.h index 4187af231295..8b6453ec1417 100644 --- a/backport/backport-include/linux/socket.h +++ b/backport/backport-include/linux/socket.h @@ -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 */