From 2bb43f4772df338f039f995d41a9cf691b0716ff Mon Sep 17 00:00:00 2001 From: "user.email" Date: Sat, 24 Oct 2026 22:45:19 -0700 Subject: [PATCH] fix(util): skip localhost side-listener for loopback-alias binds Binding a non-default loopback address already confines the server to local clients; an extra localhost listener only risks grabbing ports a colocated frontend expects to own. --- weed/util/net_timeout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/util/net_timeout.go b/weed/util/net_timeout.go index c691657fe5..abe4f62396 100644 --- a/weed/util/net_timeout.go +++ b/weed/util/net_timeout.go @@ -165,7 +165,7 @@ func NewIpAndLocalListeners(host string, port int, timeout time.Duration) (ipLis Timeout: timeout, } - if host != "localhost" && host != "" && host != "0.0.0.0" && host != "127.0.0.1" && host != "[::]" && host != "[::1]" { + if host != "localhost" && host != "" && host != "0.0.0.0" && host != "127.0.0.1" && host != "[::]" && host != "[::1]" && !isLoopbackHost(host) { listener, err = net.Listen("tcp", JoinHostPort("localhost", port)) if err != nil { glog.V(0).Infof("skip starting on %s:%d: %v", host, port, err)