Skip to content

Commit

Permalink
dnsforward: client id priority
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Apr 10, 2024
1 parent 6f36ebc commit 5d4db3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/dnsforward/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d4db3f

Please sign in to comment.