Fix ssh connections to IPv6 addresses #11816

Merged
merged 1 commit into from Aug 5, 2015

Conversation

Projects
None yet
4 participants
@amenonsen
Contributor

amenonsen commented Jul 31, 2015

We can unconditionally wrap remote_addr in square brackets for scp and
sftp (both of which require them for IPv6 addresses), but not wrap them
at all for ssh (which doesn't accept them). This way, we don't have to
detect IPv6 addresses and treat them specially.

This works for hostnames, IPv4 addresses, and IPv6 addresses.

Based on a review of PR #11677 by @JuiceboxSingularity

Fix ssh connections to IPv6 addresses
We can unconditionally wrap remote_addr in square brackets for scp and
sftp (both of which require them for IPv6 addresses), but not wrap them
at all for ssh (which doesn't accept them). This way, we don't have to
detect and treat IPv6 addresses specially. This works for hostnames,
IPv4 addresses, and IPv6 addresses.

The earlier code seemed to intend to wrap all IPv6 addresses in square
brackets, which would have broken ssh, but it actually made no attempt
to detect IPv6 addresses at all (so it broke only with IPv6 addresses
for scp and sftp).

Based on a review of PR #11677 by @JuiceboxSingularity

jimi-c added a commit that referenced this pull request Aug 5, 2015

Merge pull request #11816 from amenonsen/ssh-ipv6
Fix ssh connections to IPv6 addresses

@jimi-c jimi-c merged commit faf4c3b into ansible:devel Aug 5, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@amenonsen amenonsen deleted the amenonsen:ssh-ipv6 branch Aug 31, 2015

jaingaurav added a commit to jaingaurav/ansible that referenced this pull request Sep 7, 2015

Fix rsync connections to IPv6 addresses
Similar to ansible#11816 we can unconditionally
wrap the host address in square brackets. This is required by rsync for IPv6
addresses.

jaingaurav added a commit to jaingaurav/ansible that referenced this pull request Sep 7, 2015

Fix rsync connections to IPv6 addresses
Similar to ansible#11816 we can unconditionally
wrap the host address in square brackets. This is required by rsync for IPv6
addresses.

@ansibot ansibot added bug and removed bugfix_pull_request labels Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment