Skip to content

Commit

Permalink
Merge: + querylog,stats: anonymize client ip: /16
Browse files Browse the repository at this point in the history
Close AdguardTeam#1741

* commit '1b5fb97a023e79721e08a7ecedf1f2b36d7ebce6':
  + querylog,stats: anonymize client ip: /16
  • Loading branch information
szolin committed Jun 3, 2020
2 parents 2ecd385 + 1b5fb97 commit 539ccb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion querylog/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (l *queryLog) getClientIP(clientIP string) string {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 24
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
Expand Down
2 changes: 1 addition & 1 deletion stats/stats_unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func (s *statsCtx) getClientIP(clientIP string) string {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 24
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
Expand Down

0 comments on commit 539ccb2

Please sign in to comment.