diff --git a/makefile b/makefile index 6d4c357f..cd2d0194 100644 --- a/makefile +++ b/makefile @@ -117,7 +117,7 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) $(info using libpcap: $(call find_lib,pcap) $(call find_include,pcap)) else # default build uses dynamic libpcap NETWORK_CCDEFS = -DUSE_SHARED - $(info using libpcap: $$(call find_include,pcap)) + $(info using libpcap: $(call find_include,pcap)) endif else NETWORK_CCDEFS = -DUSE_SHARED diff --git a/sim_ether.c b/sim_ether.c index 741bb917..ebcaa0bb 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -863,6 +863,7 @@ static int (*p_pcap_setmintocopy) (pcap_t* handle, int); static HANDLE (*p_pcap_getevent) (pcap_t *); #else static int (*p_pcap_get_selectable_fd) (pcap_t *); +static int (*p_pcap_fileno) (pcap_t *); #endif static int (*p_pcap_sendpacket) (pcap_t* handle, const u_char* msg, int len); static int (*p_pcap_setfilter) (pcap_t *, struct bpf_program *); @@ -933,6 +934,7 @@ int load_pcap(void) { load_function("pcap_getevent", (void**) &p_pcap_getevent); #else load_function("pcap_get_selectable_fd", (void**) &p_pcap_get_selectable_fd); + load_function("pcap_fileno", (void**) &p_pcap_fileno); #endif load_function("pcap_sendpacket", (void**) &p_pcap_sendpacket); load_function("pcap_setfilter", (void**) &p_pcap_setfilter); @@ -1054,6 +1056,14 @@ int pcap_get_selectable_fd(pcap_t* a) { return 0; } } + +int pcap_fileno(pcap_t * a) { + if (load_pcap() != 0) { + return p_pcap_fileno(a); + } else { + return 0; + } +} #endif int pcap_sendpacket(pcap_t* a, const u_char* b, int c) {