You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ATM the IPEntry-Struct is stored in an integer with a length of 32 bytes (https://github.com/activecm/safelist-tools/blob/main/genhash/main.go#L48). Therefore only IPv4-Adresses can be stored.
When trying to use an IPv6-Adress, the script throws an error [*] Error reading data from .: json: cannot unmarshal number 42540766490510755371168322545197776895 into Go struct field EntryIPRange.ranges.ranges.end of type uint32
Unfortunately I did not find a way where GO would support uint128, to store a IPv6, natively. But there are workarounds (e.g https://pkg.go.dev/lukechampine.com/uint128). An other way could be to re-implement it.
The text was updated successfully, but these errors were encountered:
Problem
ATM the IPEntry-Struct is stored in an integer with a length of 32 bytes (https://github.com/activecm/safelist-tools/blob/main/genhash/main.go#L48). Therefore only IPv4-Adresses can be stored.
When trying to use an IPv6-Adress, the script throws an error
[*] Error reading data from .: json: cannot unmarshal number 42540766490510755371168322545197776895 into Go struct field EntryIPRange.ranges.ranges.end of type uint32
Replication
Try to hash an entry like that:
{ "comment": "", "name": "Public: fe80::/62", "ranges": { "dst": true, "network_uuid": { "Kind": 4, "Data": "/////////////////////w==" }, "ranges": [ { "end": 338288524927261089654018896841347694592, "start": 338288524927261089727805873136185901055 } ], "src": false }, "schema_version": 5, "type": "cidr" },
Possbile fix
Unfortunately I did not find a way where GO would support uint128, to store a IPv6, natively. But there are workarounds (e.g https://pkg.go.dev/lukechampine.com/uint128). An other way could be to re-implement it.
The text was updated successfully, but these errors were encountered: