Skip to content

Commit

Permalink
dnsforward: fix address
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Jan 27, 2021
1 parent 98b222b commit ed47f26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/dnsforward/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/miekg/dns"
)

// TODO(a.garipov): Cover with tests.

// Write Stats data and logs
func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
elapsed := time.Since(ctx.startTime)
Expand Down Expand Up @@ -77,8 +79,8 @@ func (s *Server) updateStats(ctx *dnsContext, elapsed time.Duration, res dnsfilt

if clientID := ctx.clientID; clientID != "" {
e.Client = clientID
} else if pctx.Addr != nil {
e.Client = pctx.Addr.String()
} else if ip := IPFromAddr(pctx.Addr); ip != nil {
e.Client = ip.String()
}

e.Time = uint32(elapsed / 1000)
Expand Down

0 comments on commit ed47f26

Please sign in to comment.