From: Martin Schwenke Date: Mon, 8 Aug 2022 01:26:54 +0000 (+1000) Subject: ctdb-build: Add --enable-pcap configure option X-Git-Tag: samba-4.17.11~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=188e949fdf687432b0a487c571fc140d66b0df11;p=thirdparty%2Fsamba.git ctdb-build: Add --enable-pcap configure option This forces the use pcap for packet capture on Linux. It appears that using a raw socket for capture does not work with infiniband - pcap support for that to come. Don't (yet?) change the default capture method to pcap. On some platforms (e.g. my personal Intel NUC, running Debian testing), pcap is much less reliable than the raw socket. However, pcap seems fine on most other platforms. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit d1543d5c7889f3ac42f80fc5d1eddf54f9c5d0d6) --- diff --git a/ctdb/wscript b/ctdb/wscript index 8f6e2bb5203..88e42439f5a 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -98,6 +98,9 @@ def options(opt): opt.add_option('--enable-etcd-reclock', help=("Enable etcd recovery lock helper (default=no)"), action="store_true", dest='ctdb_etcd_reclock', default=False) + opt.add_option('--enable-pcap', + help=("Use pcap for packet capture (default=no)"), + action="store_true", dest='ctdb_pcap', default=False) opt.add_option('--with-libcephfs', help=("Directory under which libcephfs is installed"), @@ -201,7 +204,9 @@ def configure(conf): if not conf.CHECK_VARIABLE('ETIME', headers='errno.h'): conf.DEFINE('ETIME', 'ETIMEDOUT') - if sys.platform.startswith('linux'): + if Options.options.ctdb_pcap or not sys.platform.startswith('linux'): + conf.DEFINE('ENABLE_PCAP', 1) + if not conf.env.ENABLE_PCAP: conf.SET_TARGET_TYPE('pcap', 'EMPTY') else: conf.find_program('pcap-config', var='PCAP_CONFIG')