bug 411910: when asking for a sockaddr, ask for streams only.
This commit is contained in:
parent
a60c69c81c
commit
c628faa102
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue