fix: Optimize container port detection mechanism (#10220)

This commit is contained in:
ssongliu 2025-09-01 18:14:49 +08:00 committed by GitHub
parent bc95e47b92
commit 4deb92e715
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -213,7 +213,7 @@ func ScanPortWithProto(port int, proto string) bool {
}
func ScanPortWithIP(ip string, port int) bool {
if len(ip) == 0 {
if len(ip) == 0 || ip == "0.0.0.0" || ip == "::" {
return ScanPort(port)
}
address := net.JoinHostPort(ip, fmt.Sprintf("%d", port))