From eba3bb2be2c486bc4bc7d96aabf1e68487832093 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Fri, 24 Apr 2026 14:48:29 +0300 Subject: [PATCH] Fix compiler warnings: remove incorrect address-of operator and add getpid for Windows - etcp_connections.c:1142: remove & before addr in sockaddr_storage_to_str call - test_etcp_simple_traffic.c: add #include and #define getpid _getpid for Windows --- src/etcp_connections.c | 2 +- tests/test_etcp_simple_traffic.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/etcp_connections.c b/src/etcp_connections.c index 6788da2ea..7d15df62d 100644 --- a/src/etcp_connections.c +++ b/src/etcp_connections.c @@ -1139,7 +1139,7 @@ int etcp_send_ping(struct UTUN_INSTANCE* instance, const uint8_t* peer_pubkey_bi DEBUG_ERROR(DEBUG_CATEGORY_BGP, "no socket"); return -2; } - DEBUG_ERROR(DEBUG_CATEGORY_CONNECTION, "ping N1 [%s]", sockaddr_storage_to_str(&addr).str); + DEBUG_ERROR(DEBUG_CATEGORY_CONNECTION, "ping N1 [%s]", sockaddr_storage_to_str(addr).str); return etcp_send_ping_to_socket(instance, e_sock, peer_pubkey_bin, addr, timeout_ms, cb, user_arg, user_data, user_data_len); } diff --git a/tests/test_etcp_simple_traffic.c b/tests/test_etcp_simple_traffic.c index 6c74d487b..5ea111478 100644 --- a/tests/test_etcp_simple_traffic.c +++ b/tests/test_etcp_simple_traffic.c @@ -6,6 +6,8 @@ #ifdef _WIN32 #include #include +#include +#define getpid _getpid #else #include #endif