fix(gateway): use loopback for CLI status probe when bind=lan (land #26997, thanks @chikko80)

Co-authored-by: Manuel Seitz <seitzmanuel0@gmail.com>
This commit is contained in:
Peter Steinberger
2026-02-26 12:10:02 +00:00
parent da53015ef5
commit 327f0526d1
2 changed files with 5 additions and 2 deletions

View File

@@ -5,7 +5,6 @@ import {
} from "../../daemon/constants.js";
import { resolveGatewayLogPaths } from "../../daemon/launchd.js";
import { formatRuntimeStatus } from "../../daemon/runtime-format.js";
import { pickPrimaryLanIPv4 } from "../../gateway/net.js";
import { getResolvedLoggerSettings } from "../../logging.js";
import { colorize, isRich, theme } from "../../terminal/theme.js";
import { formatCliCommand } from "../command-format.js";
@@ -73,7 +72,10 @@ export function pickProbeHostForBind(
return tailnetIPv4 ?? "127.0.0.1";
}
if (bindMode === "lan") {
return pickPrimaryLanIPv4() ?? "127.0.0.1";
// Same as call.ts: self-connections should always target loopback.
// bind=lan controls which interfaces the server listens on (0.0.0.0),
// but co-located CLI probes should connect via 127.0.0.1.
return "127.0.0.1";
}
return "127.0.0.1";
}