From: Peter Korsgaard Date: Mon, 16 Dec 2013 15:03:03 +0000 (+0100) Subject: libpcap: add upstream patch to fix runtime issue when TPACKET_V3 isn't supported X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f05f73e44d8be72aacb53d279585281b639058f;p=buildroot.git libpcap: add upstream patch to fix runtime issue when TPACKET_V3 isn't supported libpcap would fail to initialize on Linux when compiled against kernel headers with TPACKET_V3 support but running on kernel without: "can't get TPACKET_V3 header len on packet socket: Invalid argument" Signed-off-by: Peter Korsgaard --- diff --git a/package/libpcap/libpcap-0001-remove-libnl-include-path.patch b/package/libpcap/libpcap-0001-remove-libnl-include-path.patch new file mode 100644 index 0000000000..7b7106b53d --- /dev/null +++ b/package/libpcap/libpcap-0001-remove-libnl-include-path.patch @@ -0,0 +1,16 @@ +Remove hardcoded path to libnl3 include directory + +Signed-off-by: Thomas Petazzoni + +Index: b/configure.in +=================================================================== +--- a/configure.in ++++ b/configure.in +@@ -445,7 +445,6 @@ + AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x]) + AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE]) + AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api]) +- V_INCLS="$V_INCLS -I/usr/include/libnl3" + have_any_nl="yes" + ]) + diff --git a/package/libpcap/libpcap-0002-fix-TPACKET_V3-initialization-GH-329.patch b/package/libpcap/libpcap-0002-fix-TPACKET_V3-initialization-GH-329.patch new file mode 100644 index 0000000000..9d1609808b --- /dev/null +++ b/package/libpcap/libpcap-0002-fix-TPACKET_V3-initialization-GH-329.patch @@ -0,0 +1,34 @@ +From cd84bc9743d7595dee1ea4bc40bd236a619d6539 Mon Sep 17 00:00:00 2001 +From: Gabor Tatarka +Date: Mon, 2 Dec 2013 22:05:57 +0400 +Subject: [PATCH] fix TPACKET_V3 initialization (GH #329) + +libpcap would fail to initialize on Linux when compiled against kernel +headers with TPACKET_V3 support but running on kernel without: + +"can't get TPACKET_V3 header len on packet socket: Invalid argument" + +Fix init_tpacket() to respect EINVAL because that is what the kernel +returns for unsupported TPACKET versions. + +Signed-off-by: Peter Korsgaard +--- + pcap-linux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pcap-linux.c b/pcap-linux.c +index 6c0723a..8800c96 100644 +--- a/pcap-linux.c ++++ b/pcap-linux.c +@@ -3471,7 +3471,7 @@ init_tpacket(pcap_t *handle, int version, const char *version_str) + + /* Probe whether kernel supports the specified TPACKET version */ + if (getsockopt(handle->fd, SOL_PACKET, PACKET_HDRLEN, &val, &len) < 0) { +- if (errno == ENOPROTOOPT) ++ if (errno == ENOPROTOOPT || errno == EINVAL) + return 1; /* no */ + + /* Failed to even find out; this is a fatal error. */ +-- +1.8.5.1 + diff --git a/package/libpcap/libpcap-remove-libnl-include-path.patch b/package/libpcap/libpcap-remove-libnl-include-path.patch deleted file mode 100644 index 7b7106b53d..0000000000 --- a/package/libpcap/libpcap-remove-libnl-include-path.patch +++ /dev/null @@ -1,16 +0,0 @@ -Remove hardcoded path to libnl3 include directory - -Signed-off-by: Thomas Petazzoni - -Index: b/configure.in -=================================================================== ---- a/configure.in -+++ b/configure.in -@@ -445,7 +445,6 @@ - AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x]) - AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE]) - AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api]) -- V_INCLS="$V_INCLS -I/usr/include/libnl3" - have_any_nl="yes" - ]) -