cli: do not add offset when port = 0 (#2085)

This commit is contained in:
Luna Yao
2026-04-10 17:21:15 +02:00
committed by GitHub
parent a879dd1b14
commit 19c80c7b9c
2 changed files with 40 additions and 32 deletions
@@ -120,7 +120,7 @@ impl PunchConeHoleClient {
let local_addr = local_socket
.local_addr()
.with_context(|| anyhow::anyhow!("failed to get local port from udp array"))?;
.with_context(|| "failed to get local port from udp array")?;
let local_port = local_addr.port();
drop(local_socket);