summaryrefslogtreecommitdiff
path: root/scripts/firewall/vyatta-show-firewall.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/firewall/vyatta-show-firewall.pl')
-rwxr-xr-xscripts/firewall/vyatta-show-firewall.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/firewall/vyatta-show-firewall.pl b/scripts/firewall/vyatta-show-firewall.pl
index f4a161a..2de9061 100755
--- a/scripts/firewall/vyatta-show-firewall.pl
+++ b/scripts/firewall/vyatta-show-firewall.pl
@@ -89,6 +89,12 @@ my %description_hash = ( 'name' => 'IPv4',
'ipv6-modify' => 'IPv6 Modify');
+# mapping from config node to IP version string.
+my %ip_version_hash = ( 'name' => 'ipv4',
+ 'ipv6-name' => 'ipv6',
+ 'modify' => 'ipv4',
+ 'ipv6-modify' => 'ipv6');
+
sub show_chain($$$) {
my ($chain, $fh, $tree) = @_;
@@ -121,6 +127,7 @@ sub show_chain($$$) {
my $bytes = shift @stats;
my $rule = new Vyatta::IpTables::Rule;
$rule->setupOrig("firewall $tree $chain rule $_");
+ $rule->set_ip_version($ip_version_hash{$tree});
my $ipt_rules = $rule->get_num_ipt_rules();
splice(@stats, 0, (($ipt_rules - 1) * 2));
@@ -145,6 +152,7 @@ sub show_chain($$$) {
print $fh " <bytes>$bytes</bytes>\n";
my $rule = new Vyatta::IpTables::Rule;
$rule->setupDummy();
+ $rule->set_ip_version($ip_version_hash{$tree});
$rule->outputXml($fh);
print $fh " </row>\n";
}