bug 411910: when asking for a sockaddr, ask for streams only.

This commit is contained in:
Robey Pointer 2009-11-01 18:58:23 -08:00
parent a60c69c81c
commit c628faa102
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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