mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
helpers/subnetmap: fix bug when using IPv6-mapped IPv4 addresses
Go will display them as IPv4. We want everything to be IPv6.
This commit is contained in:
@@ -70,6 +70,8 @@ func SubnetMapUnmarshallerHook[V any]() mapstructure.DecodeHookFunc {
|
||||
}
|
||||
if bits == 32 {
|
||||
key = fmt.Sprintf("::ffff:%s/%d", ipNet.IP.String(), ones+96)
|
||||
} else if ipNet.IP.To4() != nil {
|
||||
key = fmt.Sprintf("::ffff:%s/%d", ipNet.IP.String(), ones)
|
||||
} else {
|
||||
key = ipNet.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user