From: Martin Schwenke Date: Tue, 5 Jul 2022 09:33:15 +0000 (+1000) Subject: ctdb-daemon: Modernise debug in ctdb_control_send_arp() X-Git-Tag: tevent-0.13.0~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5a20377347aba18700d010d4201775fc83a0b1b;p=thirdparty%2Fsamba.git ctdb-daemon: Modernise debug in ctdb_control_send_arp() For the tickle ACK logging, render the connection in a buffer. This produces more complete information. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index c1e4f683784..99efb0af356 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -387,19 +387,25 @@ static void ctdb_control_send_arp(struct tevent_context *ev, for (i=0;inum;i++) { struct ctdb_connection *tcon; + char buf[128]; tcon = &tcparray->connections[i]; - DEBUG(DEBUG_INFO,("sending tcp tickle ack for %u->%s:%u\n", - (unsigned)ntohs(tcon->dst.ip.sin_port), - ctdb_addr_to_str(&tcon->src), - (unsigned)ntohs(tcon->src.ip.sin_port))); + ret = ctdb_connection_to_buf(buf, + sizeof(buf), + tcon, + true, + " -> "); + if (ret != 0) { + strlcpy(buf, "UNKNOWN", sizeof(buf)); + } + D_INFO("Send TCP tickle ACK: %s\n", buf); ret = ctdb_sys_send_tcp( &tcon->src, &tcon->dst, 0, 0, 0); if (ret != 0) { - DEBUG(DEBUG_CRIT,(__location__ " Failed to send tcp tickle ack for %s\n", - ctdb_addr_to_str(&tcon->src))); + DBG_ERR("Failed to send TCP tickle ACK: %s\n", + buf); } } }