ctdb-server: Drop unnecessary copy of destination address
authorMartin Schwenke <mschwenke@ddn.com>
Tue, 12 Dec 2023 23:29:05 +0000 (10:29 +1100)
committerJule Anger <janger@samba.org>
Sat, 16 Dec 2023 15:26:50 +0000 (15:26 +0000)
Modernise debug while touching the code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15523

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Dec 15 12:09:21 UTC 2023 on atb-devel-224

(cherry picked from commit 4b7329f15820f1b4d9a7b7f0947719c4217b312a)

Autobuild-User(v4-18-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-18-test): Sat Dec 16 15:26:50 UTC 2023 on atb-devel-224

ctdb/server/ctdb_takeover.c

index 0148ea24de52ffcbb4e2544c4c2c27f3369ddfa8..3ecb7382e2a5217efcc96306c2ac16a8ae7e6b3d 100644 (file)
@@ -1271,7 +1271,6 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
        int ret;
        TDB_DATA data;
        struct ctdb_vnn *vnn;
-       ctdb_sock_addr dst_addr;
        char conn_str[132] = { 0, };
 
        /* If we don't have public IPs, tickles are useless */
@@ -1283,7 +1282,6 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
 
        ctdb_canonicalize_ip_inplace(&tcp_sock->src);
        ctdb_canonicalize_ip_inplace(&tcp_sock->dst);
-       dst_addr = tcp_sock->dst;
 
        ret = ctdb_connection_to_buf(conn_str,
                                     sizeof(conn_str),
@@ -1294,7 +1292,7 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
                strlcpy(conn_str, "UNKNOWN", sizeof(conn_str));
        }
 
-       vnn = find_public_ip_vnn(ctdb, &dst_addr);
+       vnn = find_public_ip_vnn(ctdb, &tcp_sock->dst);
        if (vnn == NULL) {
                D_ERR("Could not register TCP connection %s - "
                      "not a public address (client_id %u pid %u)\n",
@@ -1303,9 +1301,10 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
        }
 
        if (vnn->pnn != ctdb->pnn) {
-               DEBUG(DEBUG_ERR,("Attempt to register tcp client for IP %s we don't hold - failing (client_id %u pid %u)\n",
-                       ctdb_addr_to_str(&dst_addr),
-                       client_id, client->pid));
+               D_ERR("Attempt to register tcp client for IP %s we don't hold - "
+                     "failing (client_id %u pid %u)\n",
+                     ctdb_addr_to_str(&tcp_sock->dst),
+                     client_id, client->pid);
                /* failing this call will tell smbd to die */
                return -1;
        }