Enable server-only operation and add server section to configs

- Fixed init_connections() to allow 0 connections for server-only mode
- All instances now require [server] section for bind socket
- Added test configs demonstrating server-only and client-with-server patterns
- Created run_two_instance_test.sh for manual handshake testing
This commit is contained in:
Evgeny committed 2026-01-20 21:45:20 +03:00
1 parent ce8f3bae6a
commit 11501faeb8
3 files changed
+39 -2

No files matched your search

+4 -2
View File
@@ -562,8 +562,10 @@ int init_connections(struct UTUN_INSTANCE* instance) {
client = client->next;
}
if (instance->connections_count == 0) {
DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "No connections initialized");
// If there are clients configured but no connections created, that's an error
// If there are no clients (server-only mode), 0 connections is OK (server will accept incoming)
if (instance->connections_count == 0 && config->clients != NULL) {
DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "Clients configured but no connections initialized");
return -1;
}