Repository navigation
cmd/tailcat: accept a bare IPv6 address in socks --listen - #155
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
The socks --listen flag documents that a bare address means an OS-assigned port, but normalizeListenAddrPort appended ":0" to an unbracketed IPv6 address, so --listen=::1 became "::1:0" and the proxy exited with "too many colons in address". Join a bare IP address with port 0 via net.JoinHostPort, which brackets IPv6.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
socks --listenhelp says a bare address means an OS-assigned port. For an unbracketed IPv6 address such as::1or::,normalizeListenAddrPortappended":0", producing::1:0, and the proxy exited withlisten tcp: address ::1:0: too many colons in address.This change joins a bare IP address with port 0 through
net.JoinHostPort, which brackets IPv6 ([::1]:0). Hostnames, IPv4 addresses, bare ports, and bracketed IPv6 keep their current behavior.Testing
::1and::cases toTestNormalizeListenAddrPort. Both fail on main and pass with the change.tailcat socks --listen=::1 truenow runs the command instead of exiting with the listen error.go test ./cmd/tailcat/,go vet ./cmd/tailcat, andgofmt -lare clean.Fixes #154