]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-common: Support IB in pcap-based capture
authorMartin Schwenke <martin@meltin.net>
Mon, 15 Aug 2022 00:52:27 +0000 (10:52 +1000)
committerJule Anger <janger@samba.org>
Tue, 29 Aug 2023 09:35:11 +0000 (09:35 +0000)
Add simple support for IPoIB via DLT_LINUX_SLL and DLT_LINUX_SLL2.
This seems to work, even when an IB interface is specified.

If this is later found to be insufficient, support for DLT_IPOIB can
be implemented.  See https://www.tcpdump.org/linktypes.html for a
starting point.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 9f7d69a05b6114efe18bf4c86ca8de7789e9a96d)

ctdb/common/system_socket.c

index 9f7ca07e0982c49210e5f2851ddeec5eda1cc648..06dc558eb224b9e556297d9bfac7af827effb189 100644 (file)
@@ -1064,6 +1064,7 @@ int ctdb_sys_read_tcp_packet(int s,
                uint16_t arphrd_type = ntohs(sll->sll_hatype);
                switch (arphrd_type) {
                case ARPHRD_ETHER:
+               case ARPHRD_INFINIBAND:
                        break;
                default:
                        DBG_DEBUG("SLL: Unknown arphrd_type %"PRIu16"\n",
@@ -1081,6 +1082,7 @@ int ctdb_sys_read_tcp_packet(int s,
                uint16_t arphrd_type = ntohs(sll2->sll2_hatype);
                switch (arphrd_type) {
                case ARPHRD_ETHER:
+               case ARPHRD_INFINIBAND:
                        break;
                default:
                        DBG_DEBUG("SLL2: Unknown arphrd_type %"PRIu16"\n",