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 <process.h> and #define getpid _getpid for Windows
This commit is contained in:
Evgeny committed 2026-04-24 14:48:29 +03:00
1 parent 983c8ebdf3
commit eba3bb2be2
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -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);
}
+2
View File
@@ -6,6 +6,8 @@
#ifdef _WIN32
#include <windows.h>
#include <direct.h>
#include <process.h>
#define getpid _getpid
#else
#include <unistd.h>
#endif