From: Eric Leblond Date: Mon, 3 Dec 2018 17:06:16 +0000 (+0100) Subject: util-bpf: workaround OpenBSD old libpcap X-Git-Tag: suricata-4.1.1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64df672cf7bfff0b003fb222d556d6f87998cb5c;p=thirdparty%2Fsuricata.git util-bpf: workaround OpenBSD old libpcap OpenBSD is not using a pcap_compile_* function so we can just comment the code for OpenBSD users. --- diff --git a/src/util-bpf.c b/src/util-bpf.c index 7a23d0b565..a61ec7f23c 100644 --- a/src/util-bpf.c +++ b/src/util-bpf.c @@ -27,6 +27,7 @@ #include "suricata.h" #include "util-bpf.h" +#if !defined __OpenBSD__ /** protect bpf filter build, as it is not thread safe */ static SCMutex bpf_set_filter_lock = SCMUTEX_INITIALIZER; @@ -38,7 +39,8 @@ void SCBPFFree(struct bpf_program *program) } int SCBPFCompile(int snaplen_arg, int linktype_arg, struct bpf_program *program, - const char *buf, int optimize, uint32_t mask, + const char *buf, + int optimize, uint32_t mask, char *errbuf, size_t errbuf_len) { pcap_t *p; @@ -71,3 +73,5 @@ int SCBPFCompile(int snaplen_arg, int linktype_arg, struct bpf_program *program, return (ret); } + +#endif /* Not __OpenBSD__ */ diff --git a/src/util-bpf.h b/src/util-bpf.h index 88e2f1a03b..f38d31d5ba 100644 --- a/src/util-bpf.h +++ b/src/util-bpf.h @@ -24,10 +24,13 @@ #ifndef __UTIL_BPF_H__ #define __UTIL_BPF_H__ +#if !defined __OpenBSD__ + int SCBPFCompile(int snaplen_arg, int linktype_arg, struct bpf_program *program, const char *buf, int optimize, uint32_t mask, char *errbuf, size_t errbuf_len); void SCBPFFree(struct bpf_program *program); +#endif /* Not __OpenBSD__ */ #endif /* __UTIL_BPF_H__ */