dnsforward: access ipv6 zone

This commit is contained in:
Stanislav Chzhen 2024-04-10 16:59:37 +03:00
parent 6f36ebc06c
commit 5e0059b519
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,7 @@ func processAccessClients(
var ip netip.Addr
var ipnet netip.Prefix
if ip, err = netip.ParseAddr(s); err == nil {
ips.Add(ip)
ips.Add(ip.WithZone(""))
} else if ipnet, err = netip.ParsePrefix(s); err == nil {
*nets = append(*nets, ipnet)
} else {
@ -140,6 +140,8 @@ func (a *accessManager) isBlockedHost(host string, qt rules.RRType) (ok bool) {
// isBlockedIP returns the status of the IP address blocking as well as the rule
// that blocked it.
func (a *accessManager) isBlockedIP(ip netip.Addr) (blocked bool, rule string) {
ip = ip.WithZone("")
blocked = true
ips := a.blockedIPs
ipnets := a.blockedNets