summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2009-02-05 13:49:40 -0800
committerMohit Mehta <mohit.mehta@vyatta.com>2009-02-05 13:49:40 -0800
commitb70edadeac1f18f9887037c1772a2f88a4420027 (patch)
treed9f39a3b4e016172353d0ca3f2ecfe604c24b2ca /scripts
parent6e2fad213bc2eec10bde64ebc1cc8c5bdcf7dc3e (diff)
downloadvyatta-op-firewall-b70edadeac1f18f9887037c1772a2f88a4420027.tar.gz
vyatta-op-firewall-b70edadeac1f18f9887037c1772a2f88a4420027.zip
set IP version to retrieve correct anywhere address
Diffstat (limited to 'scripts')
-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";
}