From 9f1fe76727e98e58fc9e46ea2b49cf5c0cb48e6c Mon Sep 17 00:00:00 2001 From: Fabio Berton Date: Thu, 17 Nov 2016 13:26:34 -0200 Subject: 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 Signed-off-by: Fabio Berton Signed-off-by: Ross Burton --- ...r_state_t.ai-usage-when-INET6-is-not-defi.patch | 41 +++++++++++++ ...02-Add-missing-compiler_state_t-parameter.patch | 67 ++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch create mode 100644 meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch (limited to 'meta/recipes-connectivity/libpcap/libpcap') 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 @@ +From 64aa033a061c43fc15c711f2490ae41d23b868c3 Mon Sep 17 00:00:00 2001 +From: Fabio Berton +Date: Thu, 17 Nov 2016 09:44:42 -0200 +Subject: [PATCH 1/2] Fix compiler_state_t.ai usage when INET6 is not defined +Organization: O.S. Systems Software LTDA. + +Fix error: + +/ +| ../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; +\ + +Upstream-Status: Submitted [1] + +[1] https://github.com/the-tcpdump-group/libpcap/pull/541 + +Signed-off-by: Fabio Berton +--- + gencode.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gencode.c b/gencode.c +index a887f27..e103c70 100644 +--- a/gencode.c ++++ b/gencode.c +@@ -690,7 +690,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program, + } + initchunks(&cstate); + cstate.no_optimize = 0; ++#ifdef INET6 + cstate.ai = NULL; ++#endif + cstate.ic.root = NULL; + cstate.ic.cur_mark = 0; + cstate.bpf_pcap = p; +-- +2.1.4 + 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 @@ +From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001 +From: Fabio Berton +Date: Thu, 17 Nov 2016 09:47:29 -0200 +Subject: [PATCH 2/2] Add missing compiler_state_t parameter +Organization: O.S. Systems Software LTDA. + +Fix error: + +/ +|../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'"); +\ + +Upstream-Status: Submitted [1] + +[1] https://github.com/the-tcpdump-group/libpcap/pull/541 + +Signed-off-by: Fabio Berton +--- + gencode.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/gencode.c b/gencode.c +index e103c70..f07c0be 100644 +--- a/gencode.c ++++ b/gencode.c +@@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *, + struct in6_addr *, int, int, int); + #endif + #ifndef INET6 +-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int); ++static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int); + #endif + static struct block *gen_ipfrag(compiler_state_t *); + static struct block *gen_portatom(compiler_state_t *, int, bpf_int32); +@@ -4904,11 +4904,12 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr, + + #ifndef INET6 + static struct block * +-gen_gateway(eaddr, alist, proto, dir) +- const u_char *eaddr; +- bpf_u_int32 **alist; +- int proto; +- int dir; ++gen_gateway(cstate, eaddr, alist, proto, dir) ++ compiler_state_t *cstate; ++ const u_char *eaddr; ++ bpf_u_int32 **alist; ++ int proto; ++ int dir; + { + struct block *b0, *b1, *tmp; + +@@ -6472,7 +6473,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q) + alist = pcap_nametoaddr(name); + if (alist == NULL || *alist == NULL) + bpf_error(cstate, "unknown host '%s'", name); +- b = gen_gateway(eaddr, alist, proto, dir); ++ b = gen_gateway(cstate, eaddr, alist, proto, dir); + free(eaddr); + return b; + #else +-- +2.1.4 + -- cgit 1.2.3-korg