[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user