Skip to content

Conversation

@MeijerinkB
Copy link

A small patch that allows IPv6 addresses to be used as peers. This is currently prevented due to a conflict between net.IP (which wants the address without brackets) and net.Dial (which requires brackets).
Also modified the way peers are parsed to allow a port to be added so it becomes possible to connect to a peer not listening on the default port. Due to the way net.IP and net.SplitHostPort work this does cause the somewhat confusing situation that IPv6 addresses without a port are only accepted without brackets, but addresses with a port require them.

IPv6 addresses given to -peers are now handled in a way that prevents
conflict between net.IP (which wants the address without brackets)
and net.Dial (which requires brackets).
Ports can now also be added so it is possible to connect to peer not
listening on the default port.
@benjojo
Copy link
Owner

benjojo commented Apr 22, 2021

Looks good to me, thank you!

I'll give this a test later and if it works I'll merge

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