summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2010-06-10 13:48:29 -0700
committerMohit Mehta <mohit.mehta@vyatta.com>2010-06-10 13:48:29 -0700
commitaceae8d68a6ce4ce173e20195cd374332e273b93 (patch)
treedf8b1cb12d9669ffaf03155123c40845450f3eef /scripts
parent07420cd1508a79c6af64538a4ef08ab5839e1bf6 (diff)
downloadvyatta-nat-aceae8d68a6ce4ce173e20195cd374332e273b93.tar.gz
vyatta-nat-aceae8d68a6ce4ce173e20195cd374332e273b93.zip
start fresh for each conntrack call
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-nat-translations.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/vyatta-nat-translations.pl b/scripts/vyatta-nat-translations.pl
index 256ae70..91caa3d 100755
--- a/scripts/vyatta-nat-translations.pl
+++ b/scripts/vyatta-nat-translations.pl
@@ -246,8 +246,9 @@ if (defined $xml_file) {
}
$xml = `sudo $conntrack -L -n $ipopt -o xml $proto 2>/dev/null`;
chomp $xml;
+ $data = undef;
$data = $xs->XMLin($xml) if ! $xml eq '';
- nat_print_xml($data, 'snat');
+ nat_print_xml($data, 'snat') if defined $data;
}
if ($mode eq 'both' or $mode eq 'dnat') {
my $ipopt = "";
@@ -256,8 +257,9 @@ if (defined $xml_file) {
}
$xml = `sudo $conntrack -L -g $ipopt -o xml $proto 2>/dev/null`;
chomp $xml;
+ $data = undef;
$data = $xs->XMLin($xml) if ! $xml eq '';
- nat_print_xml($data, 'dnat');
+ nat_print_xml($data, 'dnat') if defined $data;
}
}