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

Fix IPv6 address string representation #853

merged 2 commits into from Sep 25, 2018

Fix IPv6 address string representation #853

merged 2 commits into from Sep 25, 2018


Copy link

@darkain darkain commented Sep 17, 2018

Switch from using self-supplied to standards compliant versions of IP address to/from string/binary conversion functions.

The version in ZT didn't understand IPv6 :: (double-colon) syntax, and would improperly convert shorthand IPv6 strings into the wrong binary representation.

The version in ZT didn't generate shorthand IPv6 strings either, so this makes them easier to visually parse.

No change in IPv4 conversion other than using the standard library instead of ZT custom code.

1) Use existing standard libraries to convert to/from IPv4/IPv6 strings and binary representation.
2) Move null terminator assignment InetAddress::toIpString to top of function, this way if ANY errors occurs that don't write content to the buffer, we're not passing a potentially dangerous buffer around.
@darkain darkain changed the title Dev Fix IPv6 address string representation Sep 19, 2018
@adamierymenko adamierymenko merged commit 60d5a3c into zerotier:dev Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants