Hello,

Here is a small patch adding the IPv6 support to Paramiko's client.


-- 
Maxime Ripard
Étudiant à l'Université de Technologie de Belfort - Montbéliard (UTBM)
Génie Informatique (GI 02)
diff --git a/paramiko/client.py b/paramiko/client.py
index 7870ea9..4aac841 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -273,7 +273,10 @@ class SSHClient (object):
             establishing an SSH session
         @raise socket.error: if a socket error occurred while connecting
         """
-        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        if len(hostname.split(':')) > 1:
+            sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
+        else :
+            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         if timeout is not None:
             try:
                 sock.settimeout(timeout)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
paramiko mailing list
[email protected]
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko

Reply via email to