Fix formatting of non-loopback IPv6 addresses #24
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.
Hi,
Currently the
ip_address_to_string
function formats all IPv6 addresses (except loopback) to the form8193::3512::0::0::0::0::0::1
(which is invalid) instead of one of the following representations:2001:db8:0:0:0:0:0:1
2001:0db8:0000:0000:0000:0000:0000:0001
2001:db8::1
(IETF’s recommended canonical format).I encountered the issue using Mist while binding to a specific interface. It uses
ip_address_to_string
to printListening on http://[0::0::0::0::0::0::0::0]:8080
in the console on startup, which is obviously not a valid URL in this instance.This implement RFC 5952 canonical format. Previous loopback short-hand is the default and not a special case anymore.
Please tell me if the formatting logic would be better placed in an internal module or if it’s fine as-is in the root module.