ipv6: normalize addrs per RFC-5942 §4 #25921
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RFC-5942 section 4 recommends (basically) that IPv6 addresses should have their 0's squashed together, and letters lower-cased. E.g.
A110:0:0::C8
should becomea110::c8
.An audit for the USGv6 program* that turns this recommendation into a requirement found us outputting the verbatim-from-config address in the output of
nomad agent
, and I also found vault/consul addrs in logs (namely, from our passing them to consul-template).I opted to normalize the addresses at config-parsing time, so the change runs through the whole system, rather than try to chase down each spot where we represent it visually. This is not without risk, so I could be persuaded to take a more conservative approach if desired.
* If you find the USGv6 reference hard to browse, you are not alone. The main document is here:
https://nvlpubs.nist.gov/nistpubs/specialpublications/NIST.SP.500-267Ar1.pdf
and the relevant part of it covered by this PR is section 4.1.1 and the table in 4.7.1
P.S. Related Vault PRs: hashicorp/vault#29228 & hashicorp/vault#29517