From cd4cbf19624ab892e25805d749d03d1872663a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E5=92=8F?= Date: Tue, 26 Jan 2021 12:42:56 +0800 Subject: [PATCH] When the ip4 addres is nil, it should try the next. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黎咏 --- pkg/utils/idutils/id_utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/utils/idutils/id_utils.go b/pkg/utils/idutils/id_utils.go index 3693b991..7c42984a 100644 --- a/pkg/utils/idutils/id_utils.go +++ b/pkg/utils/idutils/id_utils.go @@ -114,6 +114,9 @@ func IPv4() (net.IP, error) { } ip := ipnet.IP.To4() + if ip == nil { + continue + } return ip, nil } -- GitLab