diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c index 16463af5a33..273b9c3400e 100644 --- a/ctdb/common/system_socket.c +++ b/ctdb/common/system_socket.c @@ -1007,6 +1007,13 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data) DBG_ERR("Failed to set timeout for pcap capture\n"); goto fail; } +#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE + ret = pcap_set_immediate_mode(pt, 1); + if (ret < 0) { + DBG_ERR("Failed to set immediate mode for pcap capture\n"); + goto fail; + } +#endif ret = pcap_activate(pt); if (ret < 0) { DBG_ERR("Failed to activate pcap capture\n"); diff --git a/ctdb/wscript b/ctdb/wscript index 88e42439f5a..a7b04541014 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -221,6 +221,7 @@ def configure(conf): if not conf.CHECK_FUNCS_IN('pcap_open_live', 'pcap', headers='pcap.h'): Logs.error('Need libpcap') sys.exit(1) + conf.CHECK_FUNCS_IN('pcap_set_immediate_mode', 'pcap', headers='pcap.h') if not conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h'):