diff --git a/windows-agent/internal/daemon/daemontestutils/networking_mock.go b/windows-agent/internal/daemon/daemontestutils/networking_mock.go index ad9a4051b..dcfc0eec3 100644 --- a/windows-agent/internal/daemon/daemontestutils/networking_mock.go +++ b/windows-agent/internal/daemon/daemontestutils/networking_mock.go @@ -144,7 +144,7 @@ func getLocalPrivateIP() net.IP { return nil } for _, addr := range addrs { - if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && ipnet.IP.IsPrivate() { + if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && ipnet.IP.IsPrivate() && ipnet.IP.To4() != nil { return ipnet.IP } }