|
|
|
|
@ -387,10 +387,13 @@ int tcp_proxy_server_handle_connect(struct UTUN_INSTANCE* inst, struct ll_entry*
|
|
|
|
|
setsockopt(sock, SOL_SOCKET, SO_SETFIB, &g->tcp_proxy_server_fib, sizeof(g->tcp_proxy_server_fib)); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
// Bind to interface if specified (Linux only)
|
|
|
|
|
#ifndef _WIN32 |
|
|
|
|
if (g->tcp_proxy_server_netif_index > 0) { |
|
|
|
|
char ifname[IF_NAMESIZE]; |
|
|
|
|
if (if_indextoname(g->tcp_proxy_server_netif_index, ifname)) socket_bind_to_device(sock, ifname); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
rc->tc = tcp_conn_create(inst->ua, sock, 1500, 8192, 4, 0, inst->config->global.tcp_recv_buf, on_fin_cb, on_error_cb, rc); |
|
|
|
|
if (!rc->tc) { DEBUG_ERROR(DEBUG_CATEGORY_PROXY, "TCP proxy server: tcp_conn_create failed"); socket_close_wrapper(sock); ctx->conn_count--; u_free(rc); queue_dgram_free(entry); queue_entry_free(entry); return -1; } |
|
|
|
|
|