refactor: split socket meta 'type' into config_type and nat_type — separate config (PUBLIC/NAT/PRIVATE) from detected NAT (EIM/STRICT/DIRECT) across NODEINFO, conn_mgr, route_bgp, route_node, etcpmon; win32 compat fixes (memmem, SHUT_WR, tun test_mode, tcp_proxy guards)
This commit is contained in:
1 parent
487cb8718e
commit
389ef00da6
15 files changed
+102
-43
No files matched your search
@@ -156,11 +156,14 @@ static int instance_init_common(struct UTUN_INSTANCE* instance, struct UASYNC* u
|
||||
|
||||
// TCP proxy server (exit node, optional) — must be before tcp_proxy_client so
|
||||
// tcp_proxy_client_create can overwrite the handler if it has remote mappings
|
||||
#ifndef _WIN32
|
||||
if (tcp_proxy_server_init(instance) != 0) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_SOCKET, "Failed to initialize tcp_proxy_server (non-fatal)");
|
||||
}
|
||||
#endif
|
||||
|
||||
// TCP proxy client (from [tcp_proxy] config section)
|
||||
#ifndef _WIN32
|
||||
if (config->global.tcp_proxy_client_enabled || config->global.tcp_proxy_client_socks_enabled || config->global.tcp_proxy_client_http_proxy_enabled) {
|
||||
const char* tun_name = config->global.tcp_proxy_client_tun_name;
|
||||
const char* tun_ip = config->global.tcp_proxy_client_tun_ip;
|
||||
@@ -183,6 +186,7 @@ static int instance_init_common(struct UTUN_INSTANCE* instance, struct UASYNC* u
|
||||
} else {
|
||||
instance->tcp_proxy_client = NULL;
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -362,6 +366,7 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
|
||||
}
|
||||
|
||||
// Cleanup TCP proxy client module
|
||||
#ifndef _WIN32
|
||||
if (instance->tcp_proxy_client) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_TUN, "Destroying TCP proxy client module");
|
||||
tcp_proxy_client_destroy(instance->tcp_proxy_client);
|
||||
@@ -370,6 +375,7 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
|
||||
|
||||
// Cleanup TCP proxy server
|
||||
tcp_proxy_server_destroy(instance);
|
||||
#endif
|
||||
|
||||
// Cleanup routing module (unbinds from etcp_router before etcp_router_destroy)
|
||||
routing_destroy(instance);
|
||||
|
||||
Reference in new issue
Block a user