From 58c7d7c6e654eb0a689e7574b66c683958409c3c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 1 Aug 2016 23:30:10 +0200 Subject: [PATCH] net/haproxy: fix ACL negation not working, fixes #30 --- .../service/templates/OPNsense/HAProxy/haproxy.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 489848f5f..1e15b0ac5 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -43,7 +43,12 @@ {% for acl in action_data.linkedAcls.split(",") %} {% set acl_data = helpers.getUUID(acl) %} {% set acl_enabled = '1' %} -{% do action_acls.append('acl_' ~ acl_data.id) %} +{# # first check if this ACL condition should be negated #} +{% if acl_data.negate|default("") == '1' %} +{% do action_acls.append('!acl_' ~ acl_data.id) if acl_data.negate|default("") == '1' %} +{% else %} +{% do action_acls.append('acl_' ~ acl_data.id) %} +{% endif %} {# # check if this ACL was already defined in this scope #} {% if acl_data.id in acls_seen %} {# # DEBUG: ignoring duplicate ACL {{acl_data.name}} #}