From 853efb9dd7b7eccebc5bd8a4129f2dc487ad8120 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 13 Dec 2023 10:29:05 +1100 Subject: [PATCH] ctdb-server: Drop unnecessary copy of destination address Modernise debug while touching the code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15523 Signed-off-by: Martin Schwenke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Dec 15 12:09:21 UTC 2023 on atb-devel-224 (cherry picked from commit 4b7329f15820f1b4d9a7b7f0947719c4217b312a) Autobuild-User(v4-19-test): Jule Anger Autobuild-Date(v4-19-test): Sat Dec 16 16:08:41 UTC 2023 on atb-devel-224 --- ctdb/server/ctdb_takeover.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 5f64b9922b0..e333105e633 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -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; } -- 2.11.4.GIT