[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.
This commit is contained in:
Michael Rash
2012-11-27 22:54:55 -05:00
parent 0337ae9fb6
commit 04e0c9b560
+2 -1
View File
@@ -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