Merge: + querylog,stats: anonymize client ip: /16
Close #1741 * commit '1b5fb97a023e79721e08a7ecedf1f2b36d7ebce6': + querylog,stats: anonymize client ip: /16
This commit is contained in:
commit
539ccb2bf0
|
@ -16,7 +16,7 @@ func (l *queryLog) getClientIP(clientIP string) string {
|
||||||
ip := net.ParseIP(clientIP)
|
ip := net.ParseIP(clientIP)
|
||||||
if ip != nil {
|
if ip != nil {
|
||||||
ip4 := ip.To4()
|
ip4 := ip.To4()
|
||||||
const AnonymizeClientIP4Mask = 24
|
const AnonymizeClientIP4Mask = 16
|
||||||
const AnonymizeClientIP6Mask = 112
|
const AnonymizeClientIP6Mask = 112
|
||||||
if ip4 != nil {
|
if ip4 != nil {
|
||||||
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
|
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
|
||||||
|
|
|
@ -449,7 +449,7 @@ func (s *statsCtx) getClientIP(clientIP string) string {
|
||||||
ip := net.ParseIP(clientIP)
|
ip := net.ParseIP(clientIP)
|
||||||
if ip != nil {
|
if ip != nil {
|
||||||
ip4 := ip.To4()
|
ip4 := ip.To4()
|
||||||
const AnonymizeClientIP4Mask = 24
|
const AnonymizeClientIP4Mask = 16
|
||||||
const AnonymizeClientIP6Mask = 112
|
const AnonymizeClientIP6Mask = 112
|
||||||
if ip4 != nil {
|
if ip4 != nil {
|
||||||
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
|
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
|
||||||
|
|
Loading…
Reference in New Issue