]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tcp: Use already constructed node name
authorMartin Schwenke <mschwenke@ddn.com>
Sun, 18 Aug 2024 10:49:30 +0000 (20:49 +1000)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Aug 2024 13:06:33 +0000 (13:06 +0000)
Node has been found, so use the pre-constructed name instead of
calling ctdb_addr_to_str().

This will also print the port, which might be useful if we ever add
the ability to also specify ports in the nodes list.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
ctdb/tcp/tcp_connect.c

index 8fb041e08e69085fd08ffbe564ea31d0460eaef4..69934a7c10f66902bdbc1e18ecd4b1eb6236f295 100644 (file)
@@ -330,14 +330,14 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
        if (tnode == NULL) {
                /* This can't happen - see ctdb_tcp_initialise() */
                DBG_ERR("INTERNAL ERROR setting up connection from node %s\n",
-                       ctdb_addr_to_str(&addr));
+                       node->name);
                close(fd);
                return;
        }
 
        if (tnode->in_queue != NULL) {
                DBG_ERR("Incoming queue active, rejecting connection from %s\n",
-                       ctdb_addr_to_str(&addr));
+                       node->name);
                close(fd);
                return;
        }
@@ -371,7 +371,7 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
                                           ctdb_tcp_read_cb,
                                           node,
                                           "ctdbd-%s",
-                                          ctdb_addr_to_str(&addr));
+                                          node->name);
        if (tnode->in_queue == NULL) {
                DBG_ERR("Failed to set up incoming queue\n");
                close(fd);