mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-30 00:40:44 +01:00
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.
This commit is contained in:
1 parent
d8b725d607
commit
2bb43f4772
1 file changed
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user