From 179aa0ef3595227de97f74e136f4c3af3c6a69dd Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 12 Oct 2026 20:05:47 +0200 Subject: [PATCH] Release received packets when cold NAT priority defers PONG --- src/transport_layer/etcp_connections.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/transport_layer/etcp_connections.c b/src/transport_layer/etcp_connections.c index 202ba4ea..b85389a8 100644 --- a/src/transport_layer/etcp_connections.c +++ b/src/transport_layer/etcp_connections.c @@ -1796,7 +1796,9 @@ static int handle_ping(struct ETCP_SOCKET* e_sock, struct ETCP_DGRAM* pkt, const if ((flags & ETCP_PING_FLAG_OBSERVE) && (flags & ETCP_PING_FLAG_ADDRESS_CHECK)) { DEBUG_WARN(DEBUG_CATEGORY_NAT, "UDP probe has incompatible flags=%02x", flags); return 7; } - if (!nat_detection_ping_allowed(e_sock->instance->nat_det, e_sock, decrypted_pubkey, addr, flags, udata, ulen)) return 0; + if (!nat_detection_ping_allowed(e_sock->instance->nat_det, e_sock, decrypted_pubkey, addr, flags, udata, ulen)) { + memory_pool_free(e_sock->instance->pkt_pool, pkt); return 0; + } if ((flags & ETCP_PING_FLAG_OBSERVE) && e_sock->instance->nat_det) { nat_detection_record_observation(e_sock->instance->nat_det, e_sock, decrypted_pubkey, addr, udata, ulen); }