paramiko does not try all available address families

Bug #579530 reported by Andrew Bennetts on 2010-05-12
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Unassigned
paramiko
New
Undecided
Unassigned

Bug Description

See failure at <http://babune.ladeuil.net:24842/job/selftest-lucid/54/testReport/bzrlib.tests.test_transport/TestSSHConnections/test_bzr_connect_to_bzr_ssh/>

The situation is a server that is listening on an IPv4 address only, but that host/interface has both IPv4 and IPv6 connectivity, and getaddinfo returns the IPv6 result before the IPv4. bzr asks paramiko to connect to the right (host,port) pair by calling paramiko.Transport.

What should happen is that paramiko should successfully connect to the server.

What does happen is that paramiko attempts to connect via IPv6, that fails with connection refused, and paramiko stops there with a connection refused error.

We can workaround this in bzr by connecting the socket ourselves and passing that object instead of an address to paramiko.

Related branches

Andrew Bennetts (spiv) wrote :

Btw, see the socket.create_connection function from the Python 2.6 standard library for the right way to handle this situation.

Vincent Ladeuil (vila) wrote :

.. and it's back on maverick.

@spiv, could you build your patched package for maverick too in https://edge.launchpad.net/~spiv/+archive/packaging-test ?

Vincent Ladeuil (vila) wrote :

... and now on natty as reported by jelmer on IRC

I took the liberty of forwarding this bug and the proposed merge
upstream:

http://github.com/robey/paramiko/pull/7
http://github.com/robey/paramiko/issues#issue/7

Cheers,

Jelmer

Jelmer Vernooij (jelmer) wrote :

Cherrypicked into debian and ubuntu.

Changed in bzr:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers