1
0

002-Add-missing-compiler_state_t-parameter.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001
  2. From: Fabio Berton <fabio.berton@ossystems.com.br>
  3. Date: Thu, 17 Nov 2016 09:47:29 -0200
  4. Subject: [PATCH 2/2] Add missing compiler_state_t parameter
  5. Organization: O.S. Systems Software LTDA.
  6. Fix error:
  7. /
  8. |../libpcap-1.8.1/gencode.c: In function 'gen_gateway':
  9. |../libpcap-1.8.1/gencode.c:4914:13: error: 'cstate' undeclared
  10. | (first use in this function)
  11. | bpf_error(cstate, "direction applied to 'gateway'");
  12. \
  13. Upstream-Status: Submitted [1]
  14. [1] https://github.com/the-tcpdump-group/libpcap/pull/541
  15. Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
  16. ---
  17. gencode.c | 15 ++++++++-------
  18. 1 file changed, 8 insertions(+), 7 deletions(-)
  19. diff --git a/gencode.c b/gencode.c
  20. index e103c70..f07c0be 100644
  21. --- a/gencode.c
  22. +++ b/gencode.c
  23. @@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
  24. struct in6_addr *, int, int, int);
  25. #endif
  26. #ifndef INET6
  27. -static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
  28. +static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int);
  29. #endif
  30. static struct block *gen_ipfrag(compiler_state_t *);
  31. static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
  32. @@ -4904,11 +4904,12 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
  33. #ifndef INET6
  34. static struct block *
  35. -gen_gateway(eaddr, alist, proto, dir)
  36. - const u_char *eaddr;
  37. - bpf_u_int32 **alist;
  38. - int proto;
  39. - int dir;
  40. +gen_gateway(cstate, eaddr, alist, proto, dir)
  41. + compiler_state_t *cstate;
  42. + const u_char *eaddr;
  43. + bpf_u_int32 **alist;
  44. + int proto;
  45. + int dir;
  46. {
  47. struct block *b0, *b1, *tmp;
  48. @@ -6472,7 +6473,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
  49. alist = pcap_nametoaddr(name);
  50. if (alist == NULL || *alist == NULL)
  51. bpf_error(cstate, "unknown host '%s'", name);
  52. - b = gen_gateway(eaddr, alist, proto, dir);
  53. + b = gen_gateway(cstate, eaddr, alist, proto, dir);
  54. free(eaddr);
  55. return b;
  56. #else
  57. --
  58. 2.1.4