Skip to content

Commit 5e7d8ff

Browse files
committed
fix(infra): pin ensurePortAvailable to 127.0.0.1 in startSshPortForward
Every other probe in ssh-tunnel.ts is pinned to IPv4 loopback (pickEphemeralPort, canConnectLocal, the -L forward itself), but ensurePortAvailable was called host-less. On a dual-stack host the host-less probe binds the IPv6 wildcard :: and misses an IPv4-only occupant, reporting a busy port as free. Pass "127.0.0.1" to match the interface this caller actually owns, consistent with the fix in #94394. Fixes #94596
1 parent 54a2af3 commit 5e7d8ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/infra/ssh-tunnel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export async function startSshPortForward(opts: {
119119

120120
let localPort = opts.localPortPreferred;
121121
try {
122-
await ensurePortAvailable(localPort);
122+
await ensurePortAvailable(localPort, "127.0.0.1");
123123
} catch (err) {
124124
if (isErrno(err) && err.code === "EADDRINUSE") {
125125
localPort = await pickEphemeralPort();

0 commit comments

Comments
 (0)