From 9ae1161e853436a329f3c747761f1f5d2902761c Mon Sep 17 00:00:00 2001 From: Kris Brandow Date: Tue, 16 Aug 2022 15:22:57 -0400 Subject: [PATCH] net/dnscache: fix v4addrs to return only v4 addrs Update the v4addrs function to filter out IPv6 addresses. Fixes regression from 8725b14056. Signed-off-by: Kris Brandow --- net/dnscache/dnscache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dnscache/dnscache.go b/net/dnscache/dnscache.go index bcec3ca38..b891d0f65 100644 --- a/net/dnscache/dnscache.go +++ b/net/dnscache/dnscache.go @@ -614,7 +614,7 @@ func v4addrs(aa []net.IPAddr) (ret []netip.Addr) { for _, a := range aa { ip, ok := netip.AddrFromSlice(a.IP) ip = ip.Unmap() - if ok { + if ok && ip.Is4() { ret = append(ret, ip) } }