mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
plugin/bind: Discard link-local addresses on binding by interface name (#4531)
* Discard link-local addresses on binding Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com> * Update plugin/bind: README.md Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com> * Except for IPv6 link-local only Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>
This commit is contained in:
committed by
GitHub
parent
1b2f0bef6f
commit
deb09c8905
@@ -37,7 +37,9 @@ func setup(c *caddy.Controller) error {
|
||||
}
|
||||
for _, addr := range addrs {
|
||||
if ipnet, ok := addr.(*net.IPNet); ok {
|
||||
all = append(all, ipnet.IP.String())
|
||||
if ipnet.IP.To4() != nil || (!ipnet.IP.IsLinkLocalMulticast() && !ipnet.IP.IsLinkLocalUnicast()) {
|
||||
all = append(all, ipnet.IP.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user