]> git.ipfire.org Git - thirdparty/samba.git/commit
ctdb-common: Support "any" interface for pcap-based capture
authorMartin Schwenke <martin@meltin.net>
Mon, 15 Aug 2022 00:51:47 +0000 (10:51 +1000)
committerJule Anger <janger@samba.org>
Tue, 29 Aug 2023 09:35:11 +0000 (09:35 +0000)
commit6417651bf4ba217e6590f12e25f5fd48d76dc65a
tree16871d06b6233e38c553fdef668677ba536935bc
parent0f3864d7c596d766cd223529f817d9232ce49908
ctdb-common: Support "any" interface for pcap-based capture

This uses Linux cooked capture link-layer headers.  See:

  https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL.html
  https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL2.html

The header type needs to be checked to ensure the protocol
type (i.e. ether type, for the protocols we might be interested in) is
meaningful.  The size of the header needs to be known so it can be
skipped, allowing the IP header to be found and parsed.

It would be possible to define support for DLT_LINUX_SLL2 if it is
missing.  However, if a platform is missing support in the header file
then it is almost certainly missing in the run-time library too.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit e5541a7e0220a88d59d574d501626b0598050c52)
ctdb/common/system_socket.c