1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/ctdb/common
Martin Schwenke dc7b48c404 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
2023-08-15 10:53:52 +00:00
..
cmdline.c ctdb-common: Remove signed/unsigned comparisons 2020-02-18 02:56:38 +00:00
cmdline.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
comm.c
comm.h spelling of associated 2019-02-13 04:15:14 +01:00
common.h ctdb-common: Return value of ctdb_queue_length() should be unsigned 2019-08-14 09:11:36 +00:00
conf_tool.c ctdb-common: Add section to group commands in cmdline 2019-11-14 10:38:34 +00:00
conf_tool.h
conf.c ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
conf.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
ctdb_io.c ctdb: Use TALLOC_FREE() in a few places 2019-11-08 01:35:11 +00:00
ctdb_ltdb.c ctdb: Add missing newlines to logging messages 2023-08-08 04:39:36 +00:00
ctdb_util.c ctdb-common: Fix signed/unsigned comparisons by casting 2019-07-05 05:03:24 +00:00
db_hash.c
db_hash.h
event_script.c ctdb-common: Fix signed/unsigned comparisons by casting 2019-07-05 05:03:24 +00:00
event_script.h
hash_count.c
hash_count.h
line.c
line.h
logging_conf.c ctdb-logging: Really make NOTICE the default debug level 2023-07-10 14:21:30 +00:00
logging_conf.h
logging.c lib/util: Add "debug syslog format = always", which logs to stdout in syslog style 2023-04-06 12:51:30 +00:00
logging.h ctdb-common: Add support for reopening logs 2022-01-17 03:43:30 +00:00
path_tool.c ctdb-common: Add section to group commands in cmdline 2019-11-14 10:38:34 +00:00
path_tool.h
path.c ctdb-common: Fix signed/unsigned comparisons by casting 2019-06-05 10:25:49 +00:00
path.h
pidfile.c lib: Make pidfile_path_create() return the existing PID on conflict 2021-03-16 17:09:32 +00:00
pidfile.h
pkt_read.c
pkt_read.h
pkt_write.c
pkt_write.h
rb_tree.c ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
rb_tree.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
reqid.c
reqid.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
run_event.c ctdb-common: Fix signed/unsigned comparisons by declaring as unsigned 2019-07-05 05:03:24 +00:00
run_event.h
run_proc.c ctdb: Fix a use-after-free in run_proc 2022-10-06 15:10:20 +00:00
run_proc.h
sock_client.c
sock_client.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
sock_daemon.c ctdb-common: Separate sock_daemon's SIGHUP and SIGUSR1 handling 2022-01-17 03:43:30 +00:00
sock_daemon.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
sock_io.c ctdb-common: Fix signed/unsigned comparisons by casting 2019-07-05 05:03:24 +00:00
sock_io.h
srvid.c
srvid.h ctdb/common/srvid.h: typo fixes 2019-10-31 00:43:38 +00:00
system_socket.c ctdb-common: Set immediate mode for pcap capture 2023-08-15 10:53:52 +00:00
system_socket.h
system.c Fix spelling mistakes. 2022-09-12 02:29:32 +00:00
system.h
tmon.c ctdb-common: CID 1507498: Control flow issues (DEADCODE) 2022-08-01 09:19:55 +00:00
tmon.h ctdb:common: Fix code spelling 2023-03-24 07:01:31 +00:00
tunable.c ctdb-common: Add function ctdb_tunable_load_file() 2022-04-06 06:34:37 +00:00
tunable.h ctdb-common: Add function ctdb_tunable_load_file() 2022-04-06 06:34:37 +00:00