Skip to content

spliteAddr: support IPv6#4

Open
briantobin wants to merge 6 commits intobtfak:masterfrom
briantobin:master
Open

spliteAddr: support IPv6#4
briantobin wants to merge 6 commits intobtfak:masterfrom
briantobin:master

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.

1 participant