Skip to content

Commit 86530d8

Browse files
committed
nstun/tcp: set flow_success=true on accept paths so the defer guard doesn't immediately destroy every inbound connection
1 parent 408d49e commit 86530d8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

nstun/tcp.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,7 @@ void handle_host_tcp_accept(Context* ctx, int listen_fd, const nstun_rule_t& rul
11341134
LOG_D("Accepted inbound TCP6 %s:%u -> %s:%u (fd=%d)",
11351135
ip6_to_string(key6.daddr6).c_str(), ntohs(key6.dport),
11361136
ip6_to_string(key6.saddr6).c_str(), ntohs(key6.sport), fd);
1137+
flow_success = true;
11371138
} else {
11381139
struct sockaddr_in* client4 = reinterpret_cast<struct sockaddr_in*>(&client_ss);
11391140
struct sockaddr_in server4 = INIT_SOCKADDR_IN(AF_INET);
@@ -1169,6 +1170,7 @@ void handle_host_tcp_accept(Context* ctx, int listen_fd, const nstun_rule_t& rul
11691170
LOG_D("Accepted inbound TCP %s:%u -> %s:%u (fd=%d)",
11701171
ip4_to_string(key4.daddr4).c_str(), ntohs(key4.dport),
11711172
ip4_to_string(key4.saddr4).c_str(), ntohs(key4.sport), fd);
1173+
flow_success = true;
11721174
}
11731175
}
11741176

0 commit comments

Comments
 (0)