aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/s2s/s2sout.lib.lua
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2012-04-28 22:34:05 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2012-04-28 22:34:05 +0200
commitc113aa80c244cafc1f14e4d5942fc35f207ab120 (patch)
treecc0db87cbdd254c265a2aa042990207b71e95585 /plugins/s2s/s2sout.lib.lua
parent31dd27582930bbd9e297531046b223c35491baa5 (diff)
downloadprosody-c113aa80c244cafc1f14e4d5942fc35f207ab120.tar.gz
prosody-c113aa80c244cafc1f14e4d5942fc35f207ab120.zip
s2sout.lib: Check whether lua-socket supports IPv6
Diffstat (limited to 'plugins/s2s/s2sout.lib.lua')
-rw-r--r--plugins/s2s/s2sout.lib.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/s2s/s2sout.lib.lua b/plugins/s2s/s2sout.lib.lua
index 011c864f..f3496597 100644
--- a/plugins/s2s/s2sout.lib.lua
+++ b/plugins/s2s/s2sout.lib.lua
@@ -271,6 +271,10 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
if connect_host.proto == "IPv4" then
conn, handler = socket.tcp();
else
+ if not socket.tcp6 then
+ log("warn", "Could not connect to "..to_host..". Your version of lua-socket does not support IPv6");
+ return false, "no-ipv6";
+ end
conn, handler = socket.tcp6();
end