From: Martin Schwenke Date: Sun, 14 Aug 2022 23:41:09 +0000 (+1000) Subject: ctdb-tools: Improve/add debug X-Git-Tag: samba-4.17.11~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f01d53d8848ccd6e6a743ea42d5dd7846840d7a2;p=thirdparty%2Fsamba.git ctdb-tools: Improve/add debug In particular, knowing the reason fetching the packet fails can help with debugging unsupported protocols in the pcap code. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 5dd964aa0297b6e9ab8e1d0ff9fa0565c97ea43e) --- diff --git a/ctdb/tools/ctdb_killtcp.c b/ctdb/tools/ctdb_killtcp.c index bab81092058..007422f42fc 100644 --- a/ctdb/tools/ctdb_killtcp.c +++ b/ctdb/tools/ctdb_killtcp.c @@ -169,17 +169,18 @@ static void reset_connections_capture_tcp_handler(struct tevent_context *ev, &conn.server, &conn.client, &ack_seq, &seq, &rst, &window); if (ret != 0) { - /* probably a non-tcp ACK packet */ + /* Not a TCP-ACK? Unexpected protocol? */ + DBG_DEBUG("Failed to parse packet, errno=%d\n", ret); return; } if (window == htons(1234) && (rst || seq == 0)) { /* Ignore packets that we sent! */ - D_DEBUG("Ignoring packet: %s, " - "seq=%"PRIu32", ack_seq=%"PRIu32", " - "rst=%d, window=%"PRIu16"\n", - ctdb_connection_to_string(state, &conn, false), - seq, ack_seq, rst, ntohs(window)); + DBG_DEBUG("Ignoring sent packet: %s, " + "seq=%"PRIu32", ack_seq=%"PRIu32", " + "rst=%d, window=%"PRIu16"\n", + ctdb_connection_to_string(state, &conn, false), + seq, ack_seq, rst, ntohs(window)); return; }