changeset 2552:18b6a55dd5d6

mod_firewall: Support expressions in TO/FROM EXACTLY
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Feb 2017 14:05:39 +0000
parents 9392f45b0364
children 7ed2a66bfabd
files mod_firewall/conditions.lib.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Thu Feb 23 14:01:12 2017 +0000
+++ b/mod_firewall/conditions.lib.lua	Thu Feb 23 14:05:39 2017 +0000
@@ -66,11 +66,13 @@
 end
 
 function condition_handlers.FROM_EXACTLY(from)
-	return ("from == %q"):format(from), { "from" };
+	local metadeps = {};
+	return ("from == %s"):format(metaq(from, metadeps)), { "from", unpack(metadeps) };
 end
 
 function condition_handlers.TO_EXACTLY(to)
-	return ("to == %q"):format(to), { "to" };
+	local metadeps = {};
+	return ("to == %s"):format(metaq(to, metadeps)), { "to", unpack(metadeps) };
 end
 
 function condition_handlers.TO_SELF()