From c628faa102024354af9fcad47200e6e1fea42d5f Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sun, 1 Nov 2009 18:58:23 -0800 Subject: [PATCH] bug 411910: when asking for a sockaddr, ask for streams only. --- paramiko/client.py | 2 +- paramiko/transport.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/client.py b/paramiko/client.py index ff31c97..ce14f66 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -273,7 +273,7 @@ class SSHClient (object): establishing an SSH session @raise socket.error: if a socket error occurred while connecting """ - for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port): + for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM): if socktype == socket.SOCK_STREAM: af = family addr = sockaddr diff --git a/paramiko/transport.py b/paramiko/transport.py index 3553989..dd04206 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -285,7 +285,7 @@ class Transport (threading.Thread): if type(sock) is tuple: # connect to the given (host, port) hostname, port = sock - for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port): + for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM): if socktype == socket.SOCK_STREAM: af = family addr = sockaddr