aboutsummaryrefslogtreecommitdiffstats
path: root/core
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
commit2bb354db7f21a35ddeb16cee161047919f944b71 (patch)
tree3cea0291902a5fcdc82a59e5fe1747c4f8217900 /core
parentb47879e18077b22d5cbace5ed8bb7362ec087d33 (diff)
parentafbece2a947a2583a60daf6ec70259992c357e69 (diff)
downloadprosody-2bb354db7f21a35ddeb16cee161047919f944b71.tar.gz
prosody-2bb354db7f21a35ddeb16cee161047919f944b71.zip
Merge 0.9->trunk
Diffstat (limited to 'core')
-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