From 04e0c9b560f6dcb4136e47fec1120d61628b860e Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Tue, 27 Nov 2012 22:54:55 -0500 Subject: [PATCH] [server] Ignore pcap non-blocking setting in --pcap-file mode When setting --pcap-file mode from the command line some versions of libpcap do not appear to allow non-blocking mode to be set and throw the following error: [*] Error setting pcap nonblocking to 0: This commit ignores the non-blocking setting in --pcap-file mode. --- server/pcap_capture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/pcap_capture.c b/server/pcap_capture.c index 47be8605..64d49fb4 100644 --- a/server/pcap_capture.c +++ b/server/pcap_capture.c @@ -171,7 +171,8 @@ pcap_capture(fko_srv_options_t *opts) * to actually use this mode (which when set on a FreeBSD * system, it silently breaks the packet capture). */ - if((pcap_setnonblock(pcap, DEF_PCAP_NONBLOCK, errstr)) == -1) + if((pcap_file_mode == 0) + && (pcap_setnonblock(pcap, DEF_PCAP_NONBLOCK, errstr)) == -1) { log_msg(LOG_ERR, "[*] Error setting pcap nonblocking to %i: %s", 0, errstr