]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Modernise debug in ctdb_control_send_arp()
authorMartin Schwenke <martin@meltin.net>
Tue, 5 Jul 2022 09:33:15 +0000 (19:33 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 22 Jul 2022 16:09:31 +0000 (16:09 +0000)
For the tickle ACK logging, render the connection in a buffer.  This
produces more complete information.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c

index c1e4f68378403e63fef433391ec196d5703349c8..99efb0af356b69c583633872108652b6072d7ecb 100644 (file)
@@ -387,19 +387,25 @@ static void ctdb_control_send_arp(struct tevent_context *ev,
 
                for (i=0;i<tcparray->num;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);
                        }
                }
        }