]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
include: don't ship `linux/socket.h`
authorVincent Bernat <bernat@luffy.cx>
Tue, 31 Dec 2013 14:00:23 +0000 (15:00 +0100)
committerVincent Bernat <bernat@luffy.cx>
Tue, 31 Dec 2013 14:00:23 +0000 (15:00 +0100)
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.

include/linux/netlink.h
include/linux/socket.h [deleted file]

index ada786704db2a27aac28625e7347d1eff0c4a814..f2a7b977dbe1970a80422f6f25d43babde1a6313 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __LINUX_NETLINK_H
 #define __LINUX_NETLINK_H
 
-#include <linux/socket.h> /* for __kernel_sa_family_t */
 #include <linux/types.h>
 
 #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 (file)
index 8c1e501..0000000
+++ /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 */