diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e2178ee..2cdfab10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,10 +25,18 @@ NOTE: Add new changes BELOW THIS COMMENT. **NOTE:** `npm` may be replaced with a different tool, such as `pnpm` or `yarn`, in a future release. +### Fixed + +- Filtering for DHCP clients ([#7734]). + +- Validation process for the HTTPS port on the *Encryption Settings* page. + ### Removed - Node 18 support. +[#7734]: https://github.com/AdguardTeam/AdGuardHome/issues/7734 + @@ -64,8 +72,6 @@ See also the [v0.107.58 GitHub milestone][ms-v0.107.58]. ### Fixed -- Validation process for the HTTPS port on the *Encryption Settings* page. - - Clearing the DNS cache on the *DNS settings* page now includes both global cache and custom client cache. - Invalid ICMPv6 Router Advertisement messages ([#7547]). diff --git a/internal/client/storage.go b/internal/client/storage.go index 1a156a11..76696d79 100644 --- a/internal/client/storage.go +++ b/internal/client/storage.go @@ -496,6 +496,11 @@ func (s *Storage) FindLoose(ip netip.Addr, id string) (p *Persistent, ok bool) { return p.ShallowClone(), ok } + foundMAC := s.dhcp.MACByIP(ip) + if foundMAC != nil { + return s.FindByMAC(foundMAC) + } + p = s.index.findByIPWithoutZone(ip) if p != nil { return p.ShallowClone(), true @@ -682,6 +687,13 @@ func (s *Storage) ApplyClientFiltering(id string, addr netip.Addr, setts *filter c, ok = s.index.findByIP(addr) } + if !ok { + foundMAC := s.dhcp.MACByIP(addr) + if foundMAC != nil { + c, ok = s.FindByMAC(foundMAC) + } + } + if !ok { s.logger.Debug("no client filtering settings found", "clientid", id, "addr", addr)