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.
* 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