Diff

mod_firewall/mod_firewall.lua @ 2374:d630fa0d4dba

mod_firewall: Add default zone called '$local' containing all local hosts (dynamically)
author Matthew Wild <mwild1@gmail.com>
date Fri, 18 Nov 2016 17:22:28 +0000
parent 2368:7e1d8c46d788
child 2385:c0c2f8665c3e
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua	Fri Nov 18 10:22:28 2016 +0100
+++ b/mod_firewall/mod_firewall.lua	Fri Nov 18 17:22:28 2016 +0000
@@ -4,7 +4,12 @@
 local it = require "util.iterators";
 
 local definitions = module:shared("definitions");
-local active_definitions = {};
+local active_definitions = {
+	ZONE = {
+		-- Default zone that includes all local hosts
+		["$local"] = setmetatable({}, { __index = prosody.hosts });
+	}
+};
 
 local default_chains = {
 	preroute = {