logging: Fix for IP filtering

This commit is contained in:
Christoph Kluge 2020-11-03 00:01:58 +01:00 committed by GitHub
parent eda9a1b377
commit dd26875ffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,7 +141,7 @@ func (m IPMaskFilter) Filter(in zapcore.Field) zapcore.Field {
return in return in
} }
mask := m.v4Mask mask := m.v4Mask
if ipAddr.To16() != nil { if ipAddr.To4() == nil {
mask = m.v6Mask mask = m.v6Mask
} }
masked := ipAddr.Mask(mask) masked := ipAddr.Mask(mask)