1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/ctdb
Martin Schwenke 5fac5b7b2f ctdb-common: Set immediate mode for pcap capture
Fix a problem where ctdb_killtcp (almost always) fails to capture
packets with --enable-pcap and libpcap ≥ 1.9.1.  The problem is due to
a gradual change in libpcap semantics when using
pcap_get_selectable_fd(3PCAP) to get a file descriptor and then using
that file descriptor in non-blocking mode.

pcap_set_immediate_mode(3PCAP) says:

  pcap_set_immediate_mode() sets whether immediate mode should be set
  on a capture handle when the handle is activated.  In immediate
  mode, packets are always delivered as soon as they arrive, with no
  buffering.

and

  On Linux, with previous releases of libpcap, capture devices are
  always in immediate mode; however, in 1.5.0 and later, they are, by
  default, not in immediate mode, so if pcap_set_immediate_mode() is
  available, it should be used.

However, it wasn't until libpcap commit
2ade7676101366983bd4f86bc039ffd25da8c126 (before libpcap 1.9.1) that
it became a requirement to use pcap_set_immediate_mode(), even with a
timeout of 0.

More explanation in this libpcap issue comment:

  https://github.com/the-tcpdump-group/libpcap/issues/860#issuecomment-541204548

Do a configure check for pcap_set_immediate_mode() even though it has
existed for 10 years.  It is easy enough.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15451

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Aug 15 10:53:52 UTC 2023 on atb-devel-224

(cherry picked from commit dc7b48c404)

Autobuild-User(v4-18-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-18-test): Tue Aug 29 12:27:35 UTC 2023 on atb-devel-224
2023-08-29 12:27:35 +00:00
..
client ctdb-client: Drop unused recmaster functions 2022-01-17 10:21:33 +00:00
cluster ctdb-config: Add configuration option [cluster] leader timeout 2022-01-17 10:21:33 +00:00
common ctdb-common: Set immediate mode for pcap capture 2023-08-29 12:27:35 +00:00
config ctdb-scripts: Add debugging variable CTDB_KILLTCP_DEBUGLEVEL 2022-09-20 11:42:16 +00:00
database ctdb-database: Fix signed/unsigned comparison by casting 2019-07-05 05:03:24 +00:00
doc ctdb-doc: Fix typos in the policy routing documentation 2022-05-31 05:06:29 +00:00
event ctdb-tests: Iterate protocol tests internally 2022-02-14 04:32:29 +00:00
failover ctdb-failover: Add failover configuration options 2018-08-24 10:59:21 +02:00
ib ctdb-daemon: Rename ctdb_context private_data to transport_data 2019-11-14 02:20:46 +00:00
include ctdb-daemon: Drop unused ban_state element from CTDB node structure 2022-07-22 16:09:31 +00:00
protocol ctdb-protocol: Add separator argument to ctdb_connection_to_buf() 2022-07-22 16:09:31 +00:00
server ctdb: Fix the build on FreeBSD 2023-01-18 11:49:38 +00:00
tcp ctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect() 2020-03-12 05:29:20 +00:00
tests ctdb-tests: Reformat remaining test stubs with "shfmt -w -p -i 0 -fn" 2022-09-16 04:35:09 +00:00
tools ctdb-tools: Improve/add debug 2022-09-20 10:43:37 +00:00
utils ctdb-config: [cluster] recovery lock -> [cluster] cluster lock 2022-01-17 10:21:33 +00:00
.bzrignore
.gitignore ctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING 2019-03-15 05:17:14 +00:00
configure configure/Makefile: export PYTHONHASHSEED=1 in all 'configure/Makefile' scripts 2022-03-29 22:32:32 +00:00
configure.rpm ctdb-packaging: Update library versions to upstream versions 2018-12-18 07:12:09 +01:00
COPYING
Makefile configure/Makefile: export PYTHONHASHSEED=1 in all 'configure/Makefile' scripts 2022-03-29 22:32:32 +00:00
README doc: README - add information about CTDB, license and website 2012-10-22 17:39:49 +11:00
wscript ctdb-common: Set immediate mode for pcap capture 2023-08-29 12:27:35 +00:00

This is the release version of CTDB, a clustered implementation of TDB
database used by Samba and other projects to store temporary data.

This software is freely distributable under the GNU public license,
a copy of which you should have received with this software (in a file
called COPYING).

For documentation on CTDB, please visit CTDB website http://ctdb.samba.org.