summaryrefslogtreecommitdiff
path: root/package/libs/libpcap/patches/002-Add-missing-compiler_state_t-parameter.patch
blob: 032b265f052ebad26776ecd07fba2f9b40ee55f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001
From: Fabio Berton <fabio.berton@ossystems.com.br>
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 <fabio.berton@ossystems.com.br>
---
 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