mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	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 <mark.mickan@openlms.net> Co-authored-by: Mark Mickan <mark.mickan@openlms.net>
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user