Skip to content

Commit dd44ca0

Browse files
committed
fix(ssh-tunnel): pass host to ensurePortAvailable in startSshPortForward
- ensurePortAvailable was called without the host parameter, defaulting to "localhost" which can miss IPv4-only occupants on dual-stack hosts - Pass parsed.host to ensurePortAvailable to match the expected address family for port availability checks Fixes #94596
1 parent 37962aa commit dd44ca0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/infra/ssh-tunnel.ts

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

120120
let localPort = opts.localPortPreferred;
121121
try {
122-
await ensurePortAvailable(localPort);
122+
// FIX #94596: Pass parsed.host so ensurePortAvailable checks the correct
123+
// address family (IPv4 vs IPv6) instead of defaulting to "localhost" which
124+
// can miss IPv4-only occupants on dual-stack hosts.
125+
await ensurePortAvailable(localPort, parsed.host);
123126
} catch (err) {
124127
if (isErrno(err) && err.code === "EADDRINUSE") {
125128
localPort = await pickEphemeralPort();

0 commit comments

Comments
 (0)