dnsforward: allowed clients local

This commit is contained in:
Dimitry Kolyshev
2023-05-18 11:32:35 +03:00
parent b72a3d01b8
commit 9caf0d54c6
4 changed files with 91 additions and 36 deletions

View File

@@ -700,10 +700,12 @@ func (s *Server) IsBlockedClient(ip netip.Addr, clientID string) (blocked bool,
blockedByIP := false
if ip != (netip.Addr{}) {
blockedByIP, rule = s.access.isBlockedIP(ip)
log.Debug("by ip %v", blockedByIP)
}
allowlistMode := s.access.allowlistMode()
blockedByClientID := s.access.isBlockedClientID(clientID)
log.Debug("by client id %v", blockedByClientID)
// Allow if at least one of the checks allows in allowlist mode, but block
// if at least one of the checks blocks in blocklist mode.