dnsforward: client id priority

This commit is contained in:
Stanislav Chzhen 2024-04-10 16:19:11 +03:00
parent 6f36ebc06c
commit 5d4db3f2ec
1 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,12 @@ func (s *Server) processQueryLogsAndStats(dctx *dnsContext) (rc resultCode) {
log.Debug("dnsforward: client ip for stats and querylog: %s", ipStr)
ids := []string{ipStr, dctx.clientID}
ids := []string{ipStr}
if dctx.clientID != "" {
// Use the ClientID first because it has a higher priority.
ids = []string{dctx.clientID, ipStr}
}
qt, cl := q.Qtype, q.Qclass
// Synchronize access to s.queryLog and s.stats so they won't be suddenly