From 079a19d9322dba7f6af56c7e3c74c9525d1257b2 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Debian Linux)" <rob@synchro.net>
Date: Wed, 30 Apr 2025 17:03:12 -0700
Subject: [PATCH] Include client IP address in UDP "created client socket"
 debug log msg

Fix issue #919
---
 src/sbbs3/services.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/services.c b/src/sbbs3/services.c
index 7ab927a56b..091988bba4 100644
--- a/src/sbbs3/services.c
+++ b/src/sbbs3/services.c
@@ -2299,8 +2299,9 @@ void services_thread(void* arg)
 							continue;
 						}
 
-						lprintf(LOG_DEBUG, "%04d %s created client socket: %d"
-						        , service[i].set->socks[j].sock, service[i].protocol, client_socket);
+						inet_addrtop(&client_addr, host_ip, sizeof(host_ip));
+						lprintf(LOG_DEBUG, "%04d %s [%s] created client socket: %d"
+						        , service[i].set->socks[j].sock, service[i].protocol, host_ip, client_socket);
 
 						/* We need to set the REUSE ADDRESS socket option */
 						optval = true;
@@ -2370,8 +2371,8 @@ void services_thread(void* arg)
 						}
 						if (startup->socket_open != NULL)  /* Callback, increments socket counter */
 							startup->socket_open(startup->cbdata, true);
+						inet_addrtop(&client_addr, host_ip, sizeof(host_ip));
 					}
-					inet_addrtop(&client_addr, host_ip, sizeof(host_ip));
 
 					if (trashcan(&scfg, host_ip, "ip-silent")) {
 						FREE_AND_NULL(udp_buf);
-- 
GitLab