plugins/mod_s2s/s2sout.lib.lua
changeset 5700 94081567ea9e
parent 5552 40e7a6cf15ff
child 5701 746b263e09cf
--- 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