portmanager: Add use_ipv4 option, default to true.

This commit is contained in:
Kim Alvefur 2013-03-27 23:48:39 +01:00
parent 45fa794da0
commit 077cfbe8a4

View file

@ -18,8 +18,12 @@ module "portmanager";
--- Config
local default_interfaces = { "*" };
local default_local_interfaces = { "127.0.0.1" };
local default_interfaces = { };
local default_local_interfaces = { };
if config.get("*", "use_ipv4") ~= false then
table.insert(default_interfaces, "*");
table.insert(default_local_interfaces, "127.0.0.1");
end
if socket.tcp6 and config.get("*", "use_ipv6") ~= false then
table.insert(default_interfaces, "::");
table.insert(default_local_interfaces, "::1");