]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-bpf: workaround OpenBSD old libpcap
authorEric Leblond <eric@regit.org>
Mon, 3 Dec 2018 17:06:16 +0000 (18:06 +0100)
committerEric Leblond <eric@regit.org>
Wed, 5 Dec 2018 04:24:46 +0000 (05:24 +0100)
OpenBSD is not using a pcap_compile_* function so we can just
comment the code for OpenBSD users.

src/util-bpf.c
src/util-bpf.h

index 7a23d0b565c8255538f59ce53a6cc57c41171997..a61ec7f23ce3fd64510dbb933c1fa4c7e13bca59 100644 (file)
@@ -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__ */
index 88e2f1a03babe204b1e29dc54e88aa89daaa359f..f38d31d5badbc5a5e93c0bdd1be407649a97b899 100644 (file)
 #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__ */