backports: add DECLARE_SOCKADDR
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 24 Jan 2014 16:57:19 +0000 (17:57 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 24 Jan 2014 19:41:36 +0000 (20:41 +0100)
This is used by net/bluetooth/l2cap_sock.c

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

index 9d7cbf553db8727f40a7f1802d4c9c9b326f31fd..07981dae7ae389b87eed075c8b19df438401839c 100644 (file)
@@ -41,4 +41,9 @@ do {                                                          \
        net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
 #endif
 
+#ifndef DECLARE_SOCKADDR
+#define DECLARE_SOCKADDR(type, dst, src)       \
+       type dst = ({ __sockaddr_check_size(sizeof(*dst)); (type) src; })
+#endif
+
 #endif /* __BACKPORT_LINUX_NET_H */