first interface ipv4 address (#5186)

This commit is contained in:
Mzack9999 2024-05-19 23:12:21 +02:00 committed by GitHub
parent 5d30eb5d96
commit 9cc335a34c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,6 +180,7 @@ func interfaceAddress(interfaceName string) (net.IP, error) {
if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
if ipnet.IP.To4() != nil {
address = ipnet.IP
break
}
}
}