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

spliteAddr: support IPv6 #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

briantobin
Copy link

When given an IPv4 address, the string spliteAddr
receives looks like:
1.2.3.4:123
Splitting on ":" is fine, because the IP address
contains only integers and "." chars.

When given an IPv6 address, the string spliteAddr
receives looks like:
[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:123

The existing implementation fails on such a string.
Colons are used within IPv6 addresses.

My patch splits on the last ":" character, which works
for both IPv4 and IPv6 addresses.

Brian Tobin added 6 commits October 4, 2019 12:30
When given an IPv4 address, the string spliteAddr
receives looks like:
  1.2.3.4:123
Splitting on ":" is fine, because the IP address
contains only integers and "." chars.

When given an IPv6 address, the string spliteAddr
receives looks like:
  [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:123

The existing implementation fails on such a string.
Colons are used within IPv6 addresses.

My patch splits on the last ":" character, which works
for both IPv4 and IPv6 addresses.
@briantobin
Copy link
Author

I'm not sure how this happened, but I actually only intended one commit (93ba5e9) in the pull request. This commit adds IPv6 support. Thanks.

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.

None yet

1 participant