patch-gencode_c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --- libpcap-1.8.0.orig/gencode.c 2016-07-30 15:42:44.000000000 +0200
  2. +++ libpcap-1.8.0/gencode.c 2016-08-05 02:35:50.655555060 +0200
  3. @@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_
  4. struct in6_addr *, int, int, int);
  5. #endif
  6. #ifndef INET6
  7. -static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
  8. +static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int);
  9. #endif
  10. static struct block *gen_ipfrag(compiler_state_t *);
  11. static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
  12. @@ -690,7 +690,9 @@ pcap_compile(pcap_t *p, struct bpf_progr
  13. }
  14. initchunks(&cstate);
  15. cstate.no_optimize = 0;
  16. +#ifdef INET6
  17. cstate.ai = NULL;
  18. +#endif
  19. cstate.ic.root = NULL;
  20. cstate.ic.cur_mark = 0;
  21. cstate.bpf_pcap = p;
  22. @@ -4846,7 +4848,8 @@ gen_host6(compiler_state_t *cstate, stru
  23. #ifndef INET6
  24. static struct block *
  25. -gen_gateway(eaddr, alist, proto, dir)
  26. +gen_gateway(cstate, eaddr, alist, proto, dir)
  27. + compiler_state_t *cstate;
  28. const u_char *eaddr;
  29. bpf_u_int32 **alist;
  30. int proto;
  31. @@ -6414,7 +6417,7 @@ gen_scode(compiler_state_t *cstate, cons
  32. alist = pcap_nametoaddr(name);
  33. if (alist == NULL || *alist == NULL)
  34. bpf_error(cstate, "unknown host '%s'", name);
  35. - b = gen_gateway(eaddr, alist, proto, dir);
  36. + b = gen_gateway(cstate, eaddr, alist, proto, dir);
  37. free(eaddr);
  38. return b;
  39. #else