summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2016-08-08 15:09:23 +0200
committerJeroen Roovers <jer@gentoo.org>2016-08-08 15:10:01 +0200
commit3dadd237dced7b2750ddcebf7921a1011170e5f0 (patch)
tree36660152e9b542d8afab0f7b3539a07dd439d8bd /net-libs/libnet/files
parentdev-go/ed25519: Fix version number. (diff)
downloadgentoo-3dadd237dced7b2750ddcebf7921a1011170e5f0.tar.gz
gentoo-3dadd237dced7b2750ddcebf7921a1011170e5f0.tar.bz2
gentoo-3dadd237dced7b2750ddcebf7921a1011170e5f0.zip
net-libs/libnet: Fix building against sys-libs/musl by Petr Vaněk (bug #590738).
Package-Manager: portage-2.3.0
Diffstat (limited to 'net-libs/libnet/files')
-rw-r--r--net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch20
-rw-r--r--net-libs/libnet/files/libnet-1.1.6-musl.patch29
-rw-r--r--net-libs/libnet/files/libnet-1.2-_SOURCE.patch20
-rw-r--r--net-libs/libnet/files/libnet-1.2-sizeof.patch11
-rw-r--r--net-libs/libnet/files/libnet-1.2-socklen_t.patch11
5 files changed, 91 insertions, 0 deletions
diff --git a/net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch b/net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch
new file mode 100644
index 000000000000..25ddbc7b1104
--- /dev/null
+++ b/net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch
@@ -0,0 +1,20 @@
+--- a/configure.in
++++ b/configure.in
+@@ -157,14 +157,14 @@
+ case "$target_os" in
+
+ *linux*)
+- AC_DEFINE(_BSD_SOURCE, 1,
++ AC_DEFINE(_DEFAULT_SOURCE, 1,
+ [Define as necessary to "unhide" header symbols.])
+- AC_DEFINE(__BSD_SOURCE, 1,
++ AC_DEFINE(__DEFAULT_SOURCE, 1,
+ [Define as necessary to "unhide" header symbols.])
+ AC_DEFINE(__FAVOR_BSD, 1,
+ [Define if we should favor the BSD APIs when possible in Linux.])
+
+- LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
++ LIBNET_CONFIG_DEFINES="-D_DEFAULT_SOURCE -D__DEFAULT_SOURCE -D__FAVOR_BSD"
+ AC_CHECK_HEADERS(net/ethernet.h, \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H")
+ ;;
diff --git a/net-libs/libnet/files/libnet-1.1.6-musl.patch b/net-libs/libnet/files/libnet-1.1.6-musl.patch
new file mode 100644
index 000000000000..238fb8acbef1
--- /dev/null
+++ b/net-libs/libnet/files/libnet-1.1.6-musl.patch
@@ -0,0 +1,29 @@
+--- a/src/libnet_link_linux.c
++++ b/src/libnet_link_linux.c
+@@ -30,26 +30,15 @@
+ #include <sys/time.h>
+
+ #include <net/if.h>
+-#if (__GLIBC__)
+ #include <netinet/if_ether.h>
+ #include <net/if_arp.h>
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+
+ #if (HAVE_PACKET_SOCKET)
+ #ifndef SOL_PACKET
+ #define SOL_PACKET 263
+ #endif /* SOL_PACKET */
+-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+ #include <netpacket/packet.h>
+ #include <net/ethernet.h> /* the L2 protocols */
+-#else
+-#include <asm/types.h>
+-#include <linux/if_packet.h>
+-#include <linux/if_ether.h> /* The L2 protocols */
+-#endif
+ #endif /* HAVE_PACKET_SOCKET */
+
+ #include "../include/libnet.h"
diff --git a/net-libs/libnet/files/libnet-1.2-_SOURCE.patch b/net-libs/libnet/files/libnet-1.2-_SOURCE.patch
new file mode 100644
index 000000000000..d9c74f40e300
--- /dev/null
+++ b/net-libs/libnet/files/libnet-1.2-_SOURCE.patch
@@ -0,0 +1,20 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -157,14 +157,14 @@
+ case "$target_os" in
+
+ *linux*)
+- AC_DEFINE(_BSD_SOURCE, 1,
++ AC_DEFINE(_DEFAULT_SOURCE, 1,
+ [Define as necessary to "unhide" header symbols.])
+- AC_DEFINE(__BSD_SOURCE, 1,
++ AC_DEFINE(__DEFAULT_SOURCE, 1,
+ [Define as necessary to "unhide" header symbols.])
+ AC_DEFINE(__FAVOR_BSD, 1,
+ [Define if we should favor the BSD APIs when possible in Linux.])
+
+- LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
++ LIBNET_CONFIG_DEFINES="-D_DEFAULT_SOURCE -D__DEFAULT_SOURCE -D__FAVOR_BSD"
+ AC_CHECK_HEADERS(net/ethernet.h, \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H")
+ ;;
diff --git a/net-libs/libnet/files/libnet-1.2-sizeof.patch b/net-libs/libnet/files/libnet-1.2-sizeof.patch
new file mode 100644
index 000000000000..e06dbb5bd704
--- /dev/null
+++ b/net-libs/libnet/files/libnet-1.2-sizeof.patch
@@ -0,0 +1,11 @@
+--- a/sample/sebek.c
++++ b/sample/sebek.c
+@@ -167,7 +167,7 @@
+
+ if (payload_flag)
+ {
+- memset(cmd, 0, sizeof(cmd));
++ memset(cmd, 0, sizeof(*cmd));
+ memcpy(cmd, payload, (payload_s < 12 ? payload_s : 12));
+ length = payload_s;
+ }
diff --git a/net-libs/libnet/files/libnet-1.2-socklen_t.patch b/net-libs/libnet/files/libnet-1.2-socklen_t.patch
new file mode 100644
index 000000000000..bce36704477f
--- /dev/null
+++ b/net-libs/libnet/files/libnet-1.2-socklen_t.patch
@@ -0,0 +1,11 @@
+--- a/src/libnet_raw.c
++++ b/src/libnet_raw.c
+@@ -77,7 +77,7 @@
+ #else
+ BOOL n;
+ #endif
+- int len;
++ socklen_t len;
+
+ #ifdef SO_SNDBUF
+