diff options
author | David S. Miller <davem@davemloft.net> | 2011-08-07 22:48:07 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-07 22:48:07 -0700 |
commit | 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c (patch) | |
tree | d25eac2abeb52608af77e55b1acd56c8904aecea /include/linux/netlink.h | |
parent | dd23198e58cd35259dd09e8892bbdb90f1d57748 (diff) | |
download | lwn-6602a4baf4d1a73cc4685a39ef859e1c5ddf654c.tar.gz lwn-6602a4baf4d1a73cc4685a39ef859e1c5ddf654c.zip |
net: Make userland include of netlink.h more sane.
Currently userland will barf when including linux/netlink.h unless it
precisely includes sys/socket.h first. The issue is where the
definition of "sa_family_t" comes from.
We've been back and forth on how to fix this issue in the past, see:
http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/622621
http://thread.gmane.org/gmane.linux.network/143380
Ben Hutchings suggested we take a hint from how we handle the
sockaddr_storage type. First we define a "__kernel_sa_family_t"
to linux/socket.h that is always defined.
Then if __KERNEL__ is defined, we also define "sa_family_t" as
equal to "__kernel_sa_family_t".
Then in places like linux/netlink.h we use __kernel_sa_family_t
in user visible datastructures.
Reported-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r-- | include/linux/netlink.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 2e17c5dbdcb8..180540a84d37 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -29,7 +29,7 @@ #define MAX_LINKS 32 struct sockaddr_nl { - sa_family_t nl_family; /* AF_NETLINK */ + __kernel_sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* zero */ __u32 nl_pid; /* port ID */ __u32 nl_groups; /* multicast groups mask */ |