diff options
Diffstat (limited to 'scripts/vyatta-nat-translations.pl')
-rwxr-xr-x | scripts/vyatta-nat-translations.pl | 6 |
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; } } |