From cbcd244e0c3f7fc1b35aa5cf5ba484636568b4b7 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 26 Nov 2011 08:21:45 -0800 Subject: [PATCH] Fix builds on BSD host systems --- makefile | 2 +- sim_ether.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 37a54c57..c82fe40e 100644 --- a/makefile +++ b/makefile @@ -61,7 +61,7 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif else LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') - ifneq (,$(LDSEARCH) + ifneq (,$(LDSEARCH)) LIBPATH := $(LDSEARCH) endif ifeq (usrpkglib,$(shell if $(TEST) -d /usr/pkg/lib; then echo usrpkglib; fi)) diff --git a/sim_ether.c b/sim_ether.c index e428360c..5f33416a 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -961,7 +961,12 @@ void pcap_close(pcap_t* a) { } } +/* OpenBSD has an ancient declaration of pcap_compile which doesn't have a const in the bpf string argument */ +#if defined (__OpenBSD__) +int pcap_compile(pcap_t* a, struct bpf_program* b, char* c, int d, bpf_u_int32 e) { +#else int pcap_compile(pcap_t* a, struct bpf_program* b, const char* c, int d, bpf_u_int32 e) { +#endif if (load_pcap() != 0) { return p_pcap_compile(a, b, c, d, e); } else {