From: Vincent Bernat Date: Tue, 31 Dec 2013 14:00:23 +0000 (+0100) Subject: include: don't ship `linux/socket.h` X-Git-Tag: 0.7.8~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69a7ffa0bac894240d5817a531158440be549565;p=thirdparty%2Flldpd.git include: don't ship `linux/socket.h` It needs to be paired with `sys/socket.h` (and we don't want to ship it as it is bound to userland interface). On older libc, like Android's bionic, `sys/socket.h` is almost empty and all the definitions, including non-kernel related ones, are in `linux/socket.h`. If we ship our version of `linux/socket.h`, we have an empty `linux/socket.h` and an empty `sys/socket.h` and almost no definitions. Since `linux/netlink.h` extract `__kernel_sa_family_t` from `linux/socket.h` and we don't have it anymore, we just replace its definition by `unsigned short`. Being a Linux kernel interface, it is quite unlikely to change anytime soon. --- diff --git a/include/linux/netlink.h b/include/linux/netlink.h index ada78670..f2a7b977 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -1,7 +1,6 @@ #ifndef __LINUX_NETLINK_H #define __LINUX_NETLINK_H -#include /* for __kernel_sa_family_t */ #include #define NETLINK_ROUTE 0 /* Routing/device hook */ @@ -32,7 +31,7 @@ #define MAX_LINKS 32 struct sockaddr_nl { - __kernel_sa_family_t nl_family; /* AF_NETLINK */ + unsigned short nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* zero */ __u32 nl_pid; /* port ID */ __u32 nl_groups; /* multicast groups mask */ diff --git a/include/linux/socket.h b/include/linux/socket.h deleted file mode 100644 index 8c1e5017..00000000 --- a/include/linux/socket.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _LINUX_SOCKET_H -#define _LINUX_SOCKET_H - -/* - * Desired design of maximum size and alignment (see RFC2553) - */ -#define _K_SS_MAXSIZE 128 /* Implementation specific max size */ -#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) - /* Implementation specific desired alignment */ - -typedef unsigned short __kernel_sa_family_t; - -struct __kernel_sockaddr_storage { - __kernel_sa_family_t ss_family; /* address family */ - /* Following field(s) are implementation specific */ - char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; - /* space to achieve desired size, */ - /* _SS_MAXSIZE value minus size of ss_family */ -} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ - -#endif /* _LINUX_SOCKET_H */