# HG changeset patch # User Matthew Wild # Date 1371553900 -3600 # Node ID 94081567ea9e55c47ae9ae7246166ffe40886e93 # Parent e9f5384f5ff18292010c59295368bce490f6bccc mod_s2s/s2sout.lib: Only attempt to create an IPv6 socket if LuaSocket supports IPv6 diff -r e9f5384f5ff1 -r 94081567ea9e plugins/mod_s2s/s2sout.lib.lua --- a/plugins/mod_s2s/s2sout.lib.lua Tue Jun 18 09:04:44 2013 +0100 +++ b/plugins/mod_s2s/s2sout.lib.lua Tue Jun 18 12:11:40 2013 +0100 @@ -276,10 +276,13 @@ host_session.secure = nil; local conn, handler; - if connect_host.proto == "IPv4" then + local proto = connect_host.proto; + if proto == "IPv4" then conn, handler = socket.tcp(); + elseif proto == "IPv6" and socket.tcp6 then + conn, handler = socket.tcp6(); else - conn, handler = socket.tcp6(); + handler = "Unsupported protocol: "..tostring(proto); end if not conn then