From 1b5fb97a023e79721e08a7ecedf1f2b36d7ebce6 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Wed, 3 Jun 2020 19:08:11 +0300 Subject: [PATCH] + querylog,stats: anonymize client ip: /16 --- querylog/json.go | 2 +- stats/stats_unit.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/querylog/json.go b/querylog/json.go index 86f35e11..f9b35980 100644 --- a/querylog/json.go +++ b/querylog/json.go @@ -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() diff --git a/stats/stats_unit.go b/stats/stats_unit.go index 6ef12116..09908945 100644 --- a/stats/stats_unit.go +++ b/stats/stats_unit.go @@ -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()