From: Martin Schwenke Date: Mon, 15 Aug 2022 00:52:27 +0000 (+1000) Subject: ctdb-common: Support IB in pcap-based capture X-Git-Tag: samba-4.17.11~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5bd0b20ad365a313581b7752b6d368a6a2ece5d;p=thirdparty%2Fsamba.git ctdb-common: Support IB in pcap-based capture 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 Reviewed-by: Amitay Isaacs (cherry picked from commit 9f7d69a05b6114efe18bf4c86ca8de7789e9a96d) --- diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c index 9f7ca07e098..06dc558eb22 100644 --- a/ctdb/common/system_socket.c +++ b/ctdb/common/system_socket.c @@ -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",