From 1de92ec9dc58f79e7fed3f98fb15123ac0583401 Mon Sep 17 00:00:00 2001 From: Mark Mickan Date: Tue, 20 May 2025 22:37:46 +0930 Subject: [PATCH] fix(plugin/bind): remove zone for link-local IPv4 (#7295) This fixes a bug introduced in https://github.com/coredns/coredns/pull/6547 which resulted in the zone being added to IPv4 addresses. This bug results in a failure to start when binding to an interface with a link-local IPv4 address assigned to it, with the following error: $ ./coredns -conf=/etc/coredns/Corefile maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined lookup 169.254.1.1%dummy0: no such host Signed-off-by: Mark Mickan Co-authored-by: Mark Mickan --- plugin/bind/setup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/bind/setup.go b/plugin/bind/setup.go index f1b9dcda5..1e3ac53f0 100644 --- a/plugin/bind/setup.go +++ b/plugin/bind/setup.go @@ -85,7 +85,7 @@ func listIP(args []string, ifaces []net.Interface) ([]string, error) { if ipnet, ok := addr.(*net.IPNet); ok { ipa, err := net.ResolveIPAddr("ip", ipnet.IP.String()) if err == nil { - if len(ipnet.IP) == net.IPv6len && + if ipnet.IP.To4() == nil && (ipnet.IP.IsLinkLocalMulticast() || ipnet.IP.IsLinkLocalUnicast()) { if ipa.Zone == "" { ipa.Zone = iface.Name