mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
Return error from EncodePrefix instead of silently clamping bits
This commit is contained in:
@@ -1262,7 +1262,9 @@ func anonymizePeerConfig(config *mgmProto.PeerConfig, anonymizer *anonymize.Anon
|
||||
|
||||
if v6Prefix, err := netiputil.DecodePrefix(config.GetAddressV6()); err == nil {
|
||||
anonV6 := anonymizer.AnonymizeIP(v6Prefix.Addr())
|
||||
config.AddressV6 = netiputil.EncodePrefix(netip.PrefixFrom(anonV6, v6Prefix.Bits()))
|
||||
if b, err := netiputil.EncodePrefix(netip.PrefixFrom(anonV6, v6Prefix.Bits())); err == nil {
|
||||
config.AddressV6 = b
|
||||
}
|
||||
}
|
||||
|
||||
anonymizeSSHConfig(config.SshConfig)
|
||||
|
||||
Reference in New Issue
Block a user