diff options
author | Isaac <ibid_ag@lavabit.com> | 2012-05-12 22:37:48 -0700 |
---|---|---|
committer | Thomas Graf <tgraf@redhat.com> | 2012-05-13 11:18:28 +0200 |
commit | 996b502961976d04f058664d5083f121eb61ce4a (patch) | |
tree | 687e0cb9ef11dd92428d8829939d05721506ab1f /lib | |
parent | fec10a282355def49133e63b8a4591cc51b46478 (diff) | |
download | libnl-996b502961976d04f058664d5083f121eb61ce4a.tar.gz |
FTBFS with musl libc: Missing includes
Hello,
libnl 3.2.9 does not build with musl libc, without patching.
I' using a current musl libc (http://www.etalabs.net/musl/)
with linux 2.6.32 headers.
At first there were a couple problems on the musl side, but those are
resolved.
However, I found some other issues:
First, two files were missing
#include <byteswap.h>:
lib/netfilter/log_msg.c
lib/netfilter/queue_msg.c
These files used __bswap_64 (which should be bswap_64), a macro
declared in byteswap.h
Second, I got this error after fixing that:
In file included from nf-queue.c:16:
./include/linux/netfilter.h:53: error: field in has incomplete type
./include/linux/netfilter.h:54: error: field in6 has incomplete type
I found that src/nf-queue.c is missing an
#include <netinet/in.h>
Attached is a patch which resolves these issues. I've tested with both
musl and glibc, and it builds cleanly on both.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/netfilter/ct.c | 2 | ||||
-rw-r--r-- | lib/netfilter/log_msg.c | 3 | ||||
-rw-r--r-- | lib/netfilter/queue_msg.c | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/netfilter/ct.c b/lib/netfilter/ct.c index 9d61b6c..59ee1d9 100644 --- a/lib/netfilter/ct.c +++ b/lib/netfilter/ct.c @@ -38,7 +38,7 @@ static uint64_t ntohll(uint64_t x) #elif __BYTE_ORDER == __LITTLE_ENDIAN static uint64_t ntohll(uint64_t x) { - return __bswap_64(x); + return bswap_64(x); } #endif diff --git a/lib/netfilter/log_msg.c b/lib/netfilter/log_msg.c index cad6ddd..65448f9 100644 --- a/lib/netfilter/log_msg.c +++ b/lib/netfilter/log_msg.c @@ -26,6 +26,7 @@ #include <netlink/attr.h> #include <netlink/netfilter/nfnl.h> #include <netlink/netfilter/log_msg.h> +#include <byteswap.h> #if __BYTE_ORDER == __BIG_ENDIAN static uint64_t ntohll(uint64_t x) @@ -35,7 +36,7 @@ static uint64_t ntohll(uint64_t x) #elif __BYTE_ORDER == __LITTLE_ENDIAN static uint64_t ntohll(uint64_t x) { - return __bswap_64(x); + return bswap_64(x); } #endif diff --git a/lib/netfilter/queue_msg.c b/lib/netfilter/queue_msg.c index c40f8c2..30c522f 100644 --- a/lib/netfilter/queue_msg.c +++ b/lib/netfilter/queue_msg.c @@ -24,6 +24,7 @@ #include <netlink/attr.h> #include <netlink/netfilter/nfnl.h> #include <netlink/netfilter/queue_msg.h> +#include <byteswap.h> static struct nl_cache_ops nfnl_queue_msg_ops; @@ -35,7 +36,7 @@ static uint64_t ntohll(uint64_t x) #elif __BYTE_ORDER == __LITTLE_ENDIAN static uint64_t ntohll(uint64_t x) { - return __bswap_64(x); + return bswap_64(x); } #endif |