summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-22 07:56:32 +0100
committerGitHub <noreply@github.com>2024-01-22 07:56:32 +0100
commit39d0464616be1fc12be201223a84937b43c19382 (patch)
tree1143f24e0fbbb8026da16dc4092ff36d27435bf4 /src/op_mode
parent4412d1ae8499de3a49d99c37f66b93c6b4693295 (diff)
parent2ec023752bdd400835eb69a8f1f9d2873cef61fa (diff)
downloadvyos-1x-39d0464616be1fc12be201223a84937b43c19382.tar.gz
vyos-1x-39d0464616be1fc12be201223a84937b43c19382.zip
Merge pull request #2856 from c-po/firewall-backports
firewall: T5729: T5681: T5217: backport subsystem from current branch
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/firewall.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/op_mode/firewall.py b/src/op_mode/firewall.py
index d426b62e5..36bb013fe 100755
--- a/src/op_mode/firewall.py
+++ b/src/op_mode/firewall.py
@@ -113,19 +113,14 @@ def output_firewall_name(family, hook, priority, firewall_conf, single_rule_id=N
if hook in ['input', 'forward', 'output']:
def_action = firewall_conf['default_action'] if 'default_action' in firewall_conf else 'accept'
- row = ['default', def_action, 'all']
- rule_details = details['default-action']
- row.append(rule_details.get('packets', 0))
- row.append(rule_details.get('bytes', 0))
- rows.append(row)
+ else:
+ def_action = firewall_conf['default_action'] if 'default_action' in firewall_conf else 'drop'
+ row = ['default', def_action, 'all']
+ rule_details = details['default-action']
+ row.append(rule_details.get('packets', 0))
+ row.append(rule_details.get('bytes', 0))
- elif 'default_action' in firewall_conf and not single_rule_id:
- row = ['default', firewall_conf['default_action'], 'all']
- if 'default-action' in details:
- rule_details = details['default-action']
- row.append(rule_details.get('packets', 0))
- row.append(rule_details.get('bytes', 0))
- rows.append(row)
+ rows.append(row)
if rows:
header = ['Rule', 'Action', 'Protocol', 'Packets', 'Bytes', 'Conditions']
@@ -314,7 +309,7 @@ def show_firewall_group(name=None):
family = ['ipv6']
group_type = 'network_group'
else:
- family = ['ipv4', 'ipv6']
+ family = ['ipv4', 'ipv6', 'bridge']
for item in family:
# Look references in firewall
@@ -540,4 +535,4 @@ if __name__ == '__main__':
elif args.action == 'show_statistics':
show_statistics()
elif args.action == 'show_summary':
- show_summary() \ No newline at end of file
+ show_summary()