]> git.meshlink.io Git - meshlink/commitdiff
Let tinc-gui use correct address family when connecting to tincd via TCP.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 19 Jan 2014 20:15:23 +0000 (21:15 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 19 Jan 2014 20:15:23 +0000 (21:15 +0100)
gui/tinc-gui

index 24ca96e8f99dbceb011ac53628b042f91bc33842..75afd294a5f6f6db3d10c31b9515a864c1c8d4a5 100755 (executable)
@@ -130,7 +130,11 @@ class VPN:
                else:
                        # otherwise connect via TCP
                        print(unixfile + " does not exist.");
-                       s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+                       if ':' in info[2]:
+                               af = socket.AF_INET6
+                       else:
+                               af = socket.AF_INET
+                       s = socket.socket(af, socket.SOCK_STREAM)
                        s.connect((info[2], int(info[4])))
 
                self.sf = s.makefile()