Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any IPv6 network should stringify as ::/0 #28

Open
abraxxa opened this issue Jul 10, 2020 · 5 comments
Open

any IPv6 network should stringify as ::/0 #28

abraxxa opened this issue Jul 10, 2020 · 5 comments

Comments

@abraxxa
Copy link
Contributor

abraxxa commented Jul 10, 2020

currently ::0/0 which doesn't conform to the IPv6 standard.

@oschwald
Copy link
Member

I agree this is weird, but it is not wrong. Both representations are valid. It looks like this was intentionally introduced in this commit.

@abraxxa
Copy link
Contributor Author

abraxxa commented Jul 22, 2020

@autarch can you please comment if there is a reason to stringify like this?

@autarch
Copy link
Contributor

autarch commented Jul 22, 2020

I really can't remember why this was changed. The commit that did this is from nearly seven years ago.

@abraxxa
Copy link
Contributor Author

abraxxa commented Jul 28, 2020

I finally found the RfC I was looking for: https://tools.ietf.org/html/rfc5952
Section 4.2 describes the shortening rules but doesn't explicitly mention this case.
All operating systems I've checked show :::* for sockets listening for any IPv6 address (the third : is the delimiter between address and port, really a great choice by the IPv6 designers to use the same as the delimiter between the fields).
Are there any objections against changing the stringification to ::/0?

@oschwald
Copy link
Member

I am not opposed to a PR that does this and the RFC on the recommended formatting is a compelling argument. I would suspect that it was done as there was some variance between platforms on what inet_ntop would return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants