summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/libpcap
diff options
context:
space:
mode:
authorFabio Berton <fabio.berton@ossystems.com.br>2016-11-17 13:26:34 -0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-23 11:10:16 +0000
commitaa45fe52e9ab61e26f23dd7fc5cf8fed0edc765a (patch)
tree23a5b14f291aae55f4055e7ce0eb3727ef18fe45 /meta/recipes-connectivity/libpcap
parent354d0bc4a38307a866888df64c9e6d9049560c0f (diff)
downloadpoky-aa45fe52e9ab61e26f23dd7fc5cf8fed0edc765a.tar.gz
libpcap: Fix build when PACKAGECONFIG ipv6 is not enable
Add patches to fix error: / | ERROR: oe_runmake failed | config.status: creating pcap-config.tmp | mv pcap-config.tmp pcap-config | chmod a+x pcap-config | ../libpcap-1.8.1/gencode.c: In function 'pcap_compile': | ../libpcap-1.8.1/gencode.c:693:8: error: 'compiler_state_t | {aka struct _compiler_state}' has no member named 'ai' | cstate.ai = NULL; | ^ | ../libpcap-1.8.1/gencode.c: In function 'gen_gateway': | ../libpcap-1.8.1/gencode.c:4914:13: error: 'cstate' undeclared | (first use in this function) | bpf_error(cstate, "direction applied to 'gateway'"); | ^~~~~~ | ../libpcap-1.8.1/gencode.c:4914:13: note: each undeclared identifier is | reported only once for each function it appears in \ Patches were submitted to upstream [1] [1] https://github.com/the-tcpdump-group/libpcap/pull/541 (From OE-Core rev: 9f1fe76727e98e58fc9e46ea2b49cf5c0cb48e6c) Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@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/0002-Add-missing-compiler_state_t-parameter.patch67
-rw-r--r--meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb2
3 files changed, 110 insertions, 0 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
new file mode 100644
index 0000000000..edb6ae5667
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
@@ -0,0 +1,41 @@
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/0002-Add-missing-compiler_state_t-parameter.patch b/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
new file mode 100644
index 0000000000..032b265f05
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
@@ -0,0 +1,67 @@
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_1.8.1.bb b/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
index 9072fe0b7d..e9db28a7d7 100644
--- a/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
+++ b/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
@@ -2,6 +2,8 @@ require libpcap.inc
2 2
3SRC_URI += " \ 3SRC_URI += " \
4 file://libpcap-pkgconfig-support.patch \ 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 \
5" 7"
6 8
7SRC_URI[md5sum] = "3d48f9cd171ff12b0efd9134b52f1447" 9SRC_URI[md5sum] = "3d48f9cd171ff12b0efd9134b52f1447"