Pull request 2121: 6584-stats-non-anonymized-ips

Squashed commit of the following:

commit 4767b7bf61a277f20d8326783cc44de1b736de3d
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Dec 27 14:30:10 2023 +0300

    all: fix non-anonymized ips in stats
This commit is contained in:
Stanislav Chzhen 2023-12-27 19:47:38 +03:00
parent d75712bb95
commit b42063ee86
2 changed files with 4 additions and 2 deletions

View File

@ -58,6 +58,7 @@ NOTE: Add new changes BELOW THIS COMMENT.
### Fixed ### Fixed
- Non-anonymized IP addresses on the dashboard ([#6584]).
- Maximum cache TTL requirement when editing minimum cache TTL in the Web UI - Maximum cache TTL requirement when editing minimum cache TTL in the Web UI
([#6409]). ([#6409]).
- Load balancing algorithm stuck on a single server ([#6480]). - Load balancing algorithm stuck on a single server ([#6480]).
@ -74,6 +75,7 @@ NOTE: Add new changes BELOW THIS COMMENT.
[#6534]: https://github.com/AdguardTeam/AdGuardHome/issues/6534 [#6534]: https://github.com/AdguardTeam/AdGuardHome/issues/6534
[#6541]: https://github.com/AdguardTeam/AdGuardHome/issues/6541 [#6541]: https://github.com/AdguardTeam/AdGuardHome/issues/6541
[#6545]: https://github.com/AdguardTeam/AdGuardHome/issues/6545 [#6545]: https://github.com/AdguardTeam/AdGuardHome/issues/6545
[#6584]: https://github.com/AdguardTeam/AdGuardHome/issues/6584
<!-- <!--
NOTE: Add new changes ABOVE THIS COMMENT. NOTE: Add new changes ABOVE THIS COMMENT.

View File

@ -25,10 +25,10 @@ func (s *Server) processQueryLogsAndStats(dctx *dnsContext) (rc resultCode) {
ip := pctx.Addr.Addr().AsSlice() ip := pctx.Addr.Addr().AsSlice()
s.anonymizer.Load()(ip) s.anonymizer.Load()(ip)
ipStr := net.IP(ip).String()
log.Debug("dnsforward: client ip for stats and querylog: %s", ip) log.Debug("dnsforward: client ip for stats and querylog: %s", ipStr)
ipStr := pctx.Addr.Addr().String()
ids := []string{ipStr, dctx.clientID} ids := []string{ipStr, dctx.clientID}
qt, cl := q.Qtype, q.Qclass qt, cl := q.Qtype, q.Qclass