summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/libpcap
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2018-12-20 09:28:38 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-11 10:39:08 (GMT)
commit3049440b2834431c1d195bd5e4cf02eb978b5c42 (patch)
treefe09b021fcf218a27fce8117017cf427fc96f20f /meta/recipes-connectivity/libpcap
parent10ad7a1eeac79ff092947b9d8c28287080e35b93 (diff)
downloadpoky-3049440b2834431c1d195bd5e4cf02eb978b5c42.tar.gz
libpcap: upgrade 1.8.1 -> 1.9.0
* For changes, see: https://www.tcpdump.org/libpcap-changes.txt * Merge inc and bb and remove unnecessary flags. * Remove all patches, they have either been upstreamed or fixed differently. * Compilation with bluez5 works just fine, enable it and remove bluez4 config. * Backport a commit to fix musl builds. (From OE-Core rev: 23fa5d49667c16f6b2763f4da4de63afa632e83d) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/libpcap')
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch41
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap/0001-pcap-usb-linux.c-add-missing-limits.h-for-musl-syste.patch29
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch67
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch36
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch29
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch73
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb31
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap_1.9.0.bb (renamed from meta/recipes-connectivity/libpcap/libpcap.inc)29
8 files changed, 45 insertions, 290 deletions
diff --git a/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch b/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
deleted file mode 100644
index edb6ae5..0000000
--- a/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From 64aa033a061c43fc15c711f2490ae41d23b868c3 Mon Sep 17 00:00:00 2001
2From: Fabio Berton <fabio.berton@ossystems.com.br>
3Date: Thu, 17 Nov 2016 09:44:42 -0200
4Subject: [PATCH 1/2] Fix compiler_state_t.ai usage when INET6 is not defined
5Organization: O.S. Systems Software LTDA.
6
7Fix error:
8
9/
10| ../libpcap-1.8.1/gencode.c: In function 'pcap_compile':
11| ../libpcap-1.8.1/gencode.c:693:8: error: 'compiler_state_t
12| {aka struct _compiler_state}' has no member named 'ai'
13| cstate.ai = NULL;
14\
15
16Upstream-Status: Submitted [1]
17
18[1] https://github.com/the-tcpdump-group/libpcap/pull/541
19
20Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
21---
22 gencode.c | 2 ++
23 1 file changed, 2 insertions(+)
24
25diff --git a/gencode.c b/gencode.c
26index a887f27..e103c70 100644
27--- a/gencode.c
28+++ b/gencode.c
29@@ -690,7 +690,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
30 }
31 initchunks(&cstate);
32 cstate.no_optimize = 0;
33+#ifdef INET6
34 cstate.ai = NULL;
35+#endif
36 cstate.ic.root = NULL;
37 cstate.ic.cur_mark = 0;
38 cstate.bpf_pcap = p;
39--
402.1.4
41
diff --git a/meta/recipes-connectivity/libpcap/libpcap/0001-pcap-usb-linux.c-add-missing-limits.h-for-musl-syste.patch b/meta/recipes-connectivity/libpcap/libpcap/0001-pcap-usb-linux.c-add-missing-limits.h-for-musl-syste.patch
new file mode 100644
index 0000000..0177383
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap/0001-pcap-usb-linux.c-add-missing-limits.h-for-musl-syste.patch
@@ -0,0 +1,29 @@
1From aafa3512b7b742f5e66a5543e41974cc5e7eebfa Mon Sep 17 00:00:00 2001
2From: maxice8 <thinkabit.ukim@gmail.com>
3Date: Sun, 22 Jul 2018 18:54:17 -0300
4Subject: [PATCH] pcap-usb-linux.c: add missing limits.h for musl systems.
5
6fix compilation on musl libc systems like Void Linux and Alpine.
7
8Upstream-Status: Backport [https://github.com/the-tcpdump-group/libpcap/commit/d557c98a16dc254aaff03762b694fe624e180bea]
9
10Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
11---
12 pcap-usb-linux.c | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
16index 6f8adf65..b92c05ea 100644
17--- a/pcap-usb-linux.c
18+++ b/pcap-usb-linux.c
19@@ -50,6 +50,7 @@
20 #include <stdlib.h>
21 #include <unistd.h>
22 #include <fcntl.h>
23+#include <limits.h>
24 #include <string.h>
25 #include <dirent.h>
26 #include <byteswap.h>
27--
282.17.1
29
diff --git a/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch b/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
deleted file mode 100644
index 032b265..0000000
--- a/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001
2From: Fabio Berton <fabio.berton@ossystems.com.br>
3Date: Thu, 17 Nov 2016 09:47:29 -0200
4Subject: [PATCH 2/2] Add missing compiler_state_t parameter
5Organization: O.S. Systems Software LTDA.
6
7Fix error:
8
9/
10|../libpcap-1.8.1/gencode.c: In function 'gen_gateway':
11|../libpcap-1.8.1/gencode.c:4914:13: error: 'cstate' undeclared
12| (first use in this function)
13| bpf_error(cstate, "direction applied to 'gateway'");
14\
15
16Upstream-Status: Submitted [1]
17
18[1] https://github.com/the-tcpdump-group/libpcap/pull/541
19
20Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
21---
22 gencode.c | 15 ++++++++-------
23 1 file changed, 8 insertions(+), 7 deletions(-)
24
25diff --git a/gencode.c b/gencode.c
26index e103c70..f07c0be 100644
27--- a/gencode.c
28+++ b/gencode.c
29@@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
30 struct in6_addr *, int, int, int);
31 #endif
32 #ifndef INET6
33-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
34+static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int);
35 #endif
36 static struct block *gen_ipfrag(compiler_state_t *);
37 static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
38@@ -4904,11 +4904,12 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
39
40 #ifndef INET6
41 static struct block *
42-gen_gateway(eaddr, alist, proto, dir)
43- const u_char *eaddr;
44- bpf_u_int32 **alist;
45- int proto;
46- int dir;
47+gen_gateway(cstate, eaddr, alist, proto, dir)
48+ compiler_state_t *cstate;
49+ const u_char *eaddr;
50+ bpf_u_int32 **alist;
51+ int proto;
52+ int dir;
53 {
54 struct block *b0, *b1, *tmp;
55
56@@ -6472,7 +6473,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
57 alist = pcap_nametoaddr(name);
58 if (alist == NULL || *alist == NULL)
59 bpf_error(cstate, "unknown host '%s'", name);
60- b = gen_gateway(eaddr, alist, proto, dir);
61+ b = gen_gateway(cstate, eaddr, alist, proto, dir);
62 free(eaddr);
63 return b;
64 #else
65--
662.1.4
67
diff --git a/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch b/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch
deleted file mode 100644
index 7e1eea6..0000000
--- a/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1Disable bits of remote capture support inherited from the WinPCAP merge
2which cause applications to FTBFS if they define HAVE_REMOTE.
3
4Patch from:
5https://anonscm.debian.org/cgit/users/rfrancoise/libpcap.git/commit/?
6id=f35949969269dfdcc3549b12fade604755e1e326
7
8Upstream-Status: Pending
9
10--- a/pcap/pcap.h
11+++ b/pcap/pcap.h
12@@ -506,6 +506,11 @@
13 #define MODE_STAT 1
14 #define MODE_MON 2
15
16+#ifdef HAVE_REMOTE
17+ /* Includes most of the public stuff that is needed for the remote capture */
18+ #include <remote-ext.h>
19+#endif /* HAVE_REMOTE */
20+
21 #elif defined(MSDOS)
22
23 /*
24@@ -526,11 +531,6 @@
25
26 #endif /* _WIN32/MSDOS/UN*X */
27
28-#ifdef HAVE_REMOTE
29- /* Includes most of the public stuff that is needed for the remote capture */
30- #include <remote-ext.h>
31-#endif /* HAVE_REMOTE */
32-
33 #ifdef __cplusplus
34 }
35 #endif
36
diff --git a/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch b/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch
deleted file mode 100644
index f40e655..0000000
--- a/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1Fix a missing dependency that can result in:
2
3../libpcap-1.8.1/grammar.y:78:10: fatal error: scanner.h: No such file or directory
4
5Upstream-Status: Backport
6Signed-off-by: Ross Burton <ross.burton@intel.com>
7
8From 0dd90a6bdbce4dca14106859eee63ef643a106e2 Mon Sep 17 00:00:00 2001
9From: Alfredo Alvarez Fernandez <alfredoalvarezernandez@gmail.com>
10Date: Tue, 21 Feb 2017 11:41:43 +0100
11Subject: [PATCH] Makefile.in: Fix missing dependency
12
13---
14 Makefile.in | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/Makefile.in b/Makefile.in
18index 7044f043..f5d443ae 100644
19--- a/Makefile.in
20+++ b/Makefile.in
21@@ -465,7 +465,7 @@ grammar.h: grammar.c
22 $(MAKE) $(MAKEFLAGS) grammar.c; \
23 fi
24
25-grammar.o: grammar.c
26+grammar.o: grammar.c scanner.h
27 $(CC) $(FULL_CFLAGS) -c grammar.c
28
29 gencode.o: $(srcdir)/gencode.c grammar.h scanner.h
diff --git a/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch b/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
deleted file mode 100644
index afaa3be..0000000
--- a/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
+++ /dev/null
@@ -1,73 +0,0 @@
1From 2796129af52901dd68595e5e88a639308541def9 Mon Sep 17 00:00:00 2001
2From: Fabio Berton <fabio.berton@ossystems.com.br>
3Date: Thu, 3 Nov 2016 17:56:29 -0200
4Subject: [PATCH] libpcap: pkgconfig support
5Organization: O.S. Systems Software LTDA.
6
7Adding basic structure to support pkg-config.
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
12Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
13---
14 Makefile.in | 5 +++++
15 configure.ac | 1 +
16 libpcap.pc.in | 10 ++++++++++
17 3 files changed, 16 insertions(+)
18 create mode 100644 libpcap.pc.in
19
20diff --git a/Makefile.in b/Makefile.in
21index e71d973..d7004ed 100644
22--- a/Makefile.in
23+++ b/Makefile.in
24@@ -61,6 +61,10 @@ V_RPATH_OPT = @V_RPATH_OPT@
25 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
26 PROG=libpcap
27
28+# pkgconfig support
29+pkgconfigdir = $(libdir)/pkgconfig
30+pkgconfig_DATA = libpcap.pc
31+
32 # Standard CFLAGS
33 FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
34
35@@ -286,6 +290,7 @@ EXTRA_DIST = \
36 lbl/os-solaris2.h \
37 lbl/os-sunos4.h \
38 lbl/os-ultrix4.h \
39+ libpcap.pc \
40 missing/getopt.c \
41 missing/getopt.h \
42 missing/snprintf.c \
43diff --git a/configure.ac b/configure.ac
44index da2f940..4fc67bf 100644
45--- a/configure.ac
46+++ b/configure.ac
47@@ -1805,6 +1805,7 @@ fi
48 AC_PROG_INSTALL
49
50 AC_CONFIG_HEADER(config.h)
51+AC_CONFIG_FILES([libpcap.pc])
52
53 AC_OUTPUT_COMMANDS([if test -f .devel; then
54 echo timestamp > stamp-h
55diff --git a/libpcap.pc.in b/libpcap.pc.in
56new file mode 100644
57index 0000000..4f78ad8
58--- /dev/null
59+++ b/libpcap.pc.in
60@@ -0,0 +1,10 @@
61+prefix=@prefix@
62+exec_prefix=@exec_prefix@
63+libdir=@libdir@
64+includedir=@includedir@
65+
66+Name: libpcap
67+Description: System-independent interface for user-level packet capture.
68+Version: @VERSION@
69+Libs: -L${libdir} -lpcap
70+Cflags: -I${includedir}
71--
722.1.4
73
diff --git a/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb b/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
deleted file mode 100644
index 13dfbd6..0000000
--- a/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
+++ /dev/null
@@ -1,31 +0,0 @@
1require libpcap.inc
2
3SRC_URI += " \
4 file://libpcap-pkgconfig-support.patch \
5 file://0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch \
6 file://0002-Add-missing-compiler_state_t-parameter.patch \
7 file://disable-remote.patch \
8 file://fix-grammar-deps.patch \
9"
10
11SRC_URI[md5sum] = "3d48f9cd171ff12b0efd9134b52f1447"
12SRC_URI[sha256sum] = "673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e"
13
14#
15# make install doesn't cover the shared lib
16# make install-shared is just broken (no symlinks)
17#
18
19do_configure_prepend () {
20 #remove hardcoded references to /usr/include
21 sed 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i ${S}/configure.ac
22}
23
24do_install_prepend () {
25 install -d ${D}${libdir}
26 install -d ${D}${bindir}
27 oe_runmake install-shared DESTDIR=${D}
28 oe_libinstall -a -so libpcap ${D}${libdir}
29 sed "s|@VERSION@|${PV}|" -i ${B}/libpcap.pc
30 install -D -m 0644 libpcap.pc ${D}${libdir}/pkgconfig/libpcap.pc
31}
diff --git a/meta/recipes-connectivity/libpcap/libpcap.inc b/meta/recipes-connectivity/libpcap/libpcap_1.9.0.bb
index e57ea87..7836156 100644
--- a/meta/recipes-connectivity/libpcap/libpcap.inc
+++ b/meta/recipes-connectivity/libpcap/libpcap_1.9.0.bb
@@ -10,33 +10,36 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5eb289217c160e2920d2e35bddc36453 \
10 file://pcap.h;beginline=1;endline=32;md5=39af3510e011f34b8872f120b1dc31d2" 10 file://pcap.h;beginline=1;endline=32;md5=39af3510e011f34b8872f120b1dc31d2"
11DEPENDS = "flex-native bison-native" 11DEPENDS = "flex-native bison-native"
12 12
13INC_PR = "r5" 13SRC_URI = "https://www.tcpdump.org/release/${BP}.tar.gz \
14 file://0001-pcap-usb-linux.c-add-missing-limits.h-for-musl-syste.patch \
15 "
16SRC_URI[md5sum] = "dffd65cb14406ab9841f421732eb0f33"
17SRC_URI[sha256sum] = "2edb88808e5913fdaa8e9c1fcaf272e19b2485338742b5074b9fe44d68f37019"
14 18
15SRC_URI = "http://www.tcpdump.org/release/${BP}.tar.gz" 19inherit autotools binconfig-disabled pkgconfig bluetooth
16 20
17BINCONFIG = "${bindir}/pcap-config" 21BINCONFIG = "${bindir}/pcap-config"
18 22
19inherit autotools binconfig-disabled pkgconfig bluetooth 23# Explicitly disable dag support. We don't have recipe for it and if enabled here,
20 24# configure script poisons the include dirs with /usr/local/include even when the
21EXTRA_OECONF = "--with-pcap=linux" 25# support hasn't been detected.
26EXTRA_OECONF = " \
27 --with-pcap=linux \
28 --without-dag \
29 "
22EXTRA_AUTORECONF += "--exclude=aclocal" 30EXTRA_AUTORECONF += "--exclude=aclocal"
23 31
24PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \ 32PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
25 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ 33 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
26" 34"
27PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4" 35PACKAGECONFIG[bluez5] = "--enable-bluetooth,--disable-bluetooth,bluez5"
28# Add a dummy PACKAGECONFIG for bluez5 since it is not supported by libpcap.
29PACKAGECONFIG[bluez5] = ",,"
30PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" 36PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
31PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," 37PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
32PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl" 38PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl"
33 39
34CPPFLAGS_prepend = "-I${S} "
35CFLAGS_prepend = "-I${S} "
36CXXFLAGS_prepend = "-I${S} "
37
38do_configure_prepend () { 40do_configure_prepend () {
39 sed -i -e's,^V_RPATH_OPT=.*$,V_RPATH_OPT=,' ${S}/pcap-config.in 41 #remove hardcoded references to /usr/include
42 sed 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i ${S}/configure.ac
40} 43}
41 44
42BBCLASSEXTEND = "native" 45BBCLASSEXTEND = "native"