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
|
establishing an SSH session
|
||||||
@raise socket.error: if a socket error occurred while connecting
|
@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:
|
if socktype == socket.SOCK_STREAM:
|
||||||
af = family
|
af = family
|
||||||
addr = sockaddr
|
addr = sockaddr
|
||||||
|
|
|
@ -285,7 +285,7 @@ class Transport (threading.Thread):
|
||||||
if type(sock) is tuple:
|
if type(sock) is tuple:
|
||||||
# connect to the given (host, port)
|
# connect to the given (host, port)
|
||||||
hostname, port = sock
|
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:
|
if socktype == socket.SOCK_STREAM:
|
||||||
af = family
|
af = family
|
||||||
addr = sockaddr
|
addr = sockaddr
|
||||||
|
|
Loading…
Reference in New Issue