aboutsummaryrefslogtreecommitdiffstats
path: root/core/portmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-03-28 12:17:15 +0000
committerMatthew Wild <mwild1@gmail.com>2013-03-28 12:17:15 +0000
commit0f44b53c15ed12d163902afaf93a88442d4c97d2 (patch)
tree3cea0291902a5fcdc82a59e5fe1747c4f8217900 /core/portmanager.lua
parent11a3a158eb42284dd3585e04439f38ee3e6d548c (diff)
parent64440086ea5ee8d2f1726f2101ced46d4f08b929 (diff)
downloadprosody-0f44b53c15ed12d163902afaf93a88442d4c97d2.tar.gz
prosody-0f44b53c15ed12d163902afaf93a88442d4c97d2.zip
Merge 0.9->trunk
Diffstat (limited to 'core/portmanager.lua')
-rw-r--r--core/portmanager.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index b02ba53b..9684e9db 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -1,6 +1,7 @@
local config = require "core.configmanager";
local certmanager = require "core.certmanager";
local server = require "net.server";
+local socket = require "socket";
local log = require "util.logger".init("portmanager");
local multitable = require "util.multitable";
@@ -17,9 +18,13 @@ module "portmanager";
--- Config
-local default_interfaces = { "*" };
-local default_local_interfaces = { "127.0.0.1" };
-if config.get("*", "use_ipv6") then
+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");
end