Skip to content

Conversation

@darkain
Copy link
Contributor

@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants