summaryrefslogtreecommitdiff
path: root/python/vyos/firewall.py
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-01-20 00:27:53 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-01-20 11:14:43 +0100
commitd1d0150b6a40252700181530ca87c5699a4bd0b4 (patch)
treeb61b5943369de9f185dea682e933e195f2d91cf4 /python/vyos/firewall.py
parent569dfa77f07cb707dec4b29ed3e2a350e214af80 (diff)
downloadvyos-1x-d1d0150b6a40252700181530ca87c5699a4bd0b4.tar.gz
vyos-1x-d1d0150b6a40252700181530ca87c5699a4bd0b4.zip
firewall: T2199: Add log prefix to match legacy perl behaviour
Example syslog: [FWNAME-default-D] ... * Also clean-up firewall default-action
Diffstat (limited to 'python/vyos/firewall.py')
-rw-r--r--python/vyos/firewall.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index 2ab78ff18..808e90e38 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -121,7 +121,8 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name):
output.append(f'{proto} {prefix}port $P_{group_name}')
if 'log' in rule_conf and rule_conf['log'] == 'enable':
- output.append('log')
+ action = rule_conf['action'] if 'action' in rule_conf else 'accept'
+ output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}] "')
if 'hop_limit' in rule_conf:
operators = {'eq': '==', 'gt': '>', 'lt': '<'}