From 33bffc11fe97b60932da25a8a5b428316fdc86eb Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 18 May 2022 13:35:11 +0000 Subject: firewall: T4430: Extend column for rules op-mode As we extended firewall rules to 1000000 in 7e00db3 Output from firewall column "action" should be shifted to the right by a few characters Cosmetic fix --- scripts/firewall/vyatta-show-firewall.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/firewall/vyatta-show-firewall.pl b/scripts/firewall/vyatta-show-firewall.pl index 051a00c..3f16894 100755 --- a/scripts/firewall/vyatta-show-firewall.pl +++ b/scripts/firewall/vyatta-show-firewall.pl @@ -46,7 +46,7 @@ sub convert_to_easyunits { } sub numerically { $a <=> $b; } -my $format1 = "%-5s %-8s %-9s %-8s %-40s"; +my $format1 = "%-9s %-8s %-9s %-8s %-40s"; my $format2 = " %-78s"; # mapping from config node to root config node. -- cgit v1.2.3 From cd7190eda077060445f516f1b2fd83c4cb45b81d Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 18 May 2022 14:36:08 +0000 Subject: firewall: T2194: Fix firewall op-mode garbled output Different output from "iptables -L" in 1.3 compared to 1.2 This way parser can't process output correctly at least "comment" --- scripts/firewall/vyatta-show-firewall.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/firewall/vyatta-show-firewall.pl b/scripts/firewall/vyatta-show-firewall.pl index 3f16894..a4b3ce7 100755 --- a/scripts/firewall/vyatta-show-firewall.pl +++ b/scripts/firewall/vyatta-show-firewall.pl @@ -329,6 +329,8 @@ sub print_detail_rule { # trim leading and trailing whitespaces $string =~ s/^\s+|\s+$//g; + # Hide comments like /* foo-20 */ T2194 + $string =~ s/\/\* $chain-$rule \*\///; @string_words = split (/\s+/, $string, 13); @string_words_part1=splice(@string_words, 0, 4); # packets, bytes, target, proto @@ -359,7 +361,7 @@ sub print_detail_rule { if ($iptables_cmd =~ /6/) { @string_words_part3=splice(@string_words, 5);# all other matches after comment } else { - @string_words_part3=splice(@string_words, 6);# all other matches after comment + @string_words_part3=splice(@string_words, 3);# all other matches after comment } } my $condition='condition - '; -- cgit v1.2.3