-#!/usr/bin/python
+#!/usr/bin/env python
# tinc-gui -- GUI for controlling a running tincd
-# Copyright (C) 2009-2012 Guus Sliepen <guus@tinc-vpn.org>
+# Copyright (C) 2009-2014 Guus Sliepen <guus@tinc-vpn.org>
+# 2014 Dennis Joachimsthaler <dennis@efjot.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
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()