From f65e896bd9053a76dc84d8a287fea89c796efafa Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Mon, 25 Jun 2012 02:43:00 +0200 Subject: [PATCH] Added checks for ipv6 support --- servefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servefile b/servefile index 7976a23..05279b2 100755 --- a/servefile +++ b/servefile @@ -1000,6 +1000,10 @@ def main(): print "You can't listen both on IPv4 and IPv6 \"only\"" sys.exit(1) + if args.ipv6_only and not socket.has_ipv6: + print "Your system does not support IPv6" + sys.exit(1) + mode = None if args.upload: mode = ServeFile.MODE_UPLOAD @@ -1023,7 +1027,7 @@ def main(): server.setAuth(user, password) if compression and compression != "none": server.setCompression(compression) - if args.ipv4_only: + if args.ipv4_only or not socket.has_ipv6: server.setIPv6(False) if args.ipv6_only: server.setIPv4(False)