diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-05-12 17:56:47 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-05-12 17:56:47 -0700 |
commit | d957485bb72167f52d2563c574b7df3d9708e0f6 (patch) | |
tree | 9b2359a5d706d8e6fe8f62b97e6b9d7158248d48 | |
parent | 5b0fe6b28c5d085c46d299af4dcf8f303dada9c4 (diff) | |
download | vyatta-nat-d957485bb72167f52d2563c574b7df3d9708e0f6.tar.gz vyatta-nat-d957485bb72167f52d2563c574b7df3d9708e0f6.zip |
fix for bug 3246: show error message when NAT rule has no "type".
-rw-r--r-- | scripts/VyattaNatRule.pm | 4 | ||||
-rwxr-xr-x | scripts/vyatta-update-nat.pl | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/scripts/VyattaNatRule.pm b/scripts/VyattaNatRule.pm index a920f72..bd0c598 100644 --- a/scripts/VyattaNatRule.pm +++ b/scripts/VyattaNatRule.pm @@ -220,7 +220,7 @@ sub rule_str { } elsif ($self->{_type} ne "masquerade") { return (undef, "outside-address not specified"); } - } else { + } elsif ($self->{_type} eq "destination") { # type is destination if ($self->{_exclude}) { $rule_str .= "-j RETURN"; @@ -279,6 +279,8 @@ sub rule_str { } else { return (undef, "inside-address not specified"); } + } else { + return (undef, "rule type not specified/valid"); } # source rule string diff --git a/scripts/vyatta-update-nat.pl b/scripts/vyatta-update-nat.pl index acfc0b8..4f95ad9 100755 --- a/scripts/vyatta-update-nat.pl +++ b/scripts/vyatta-update-nat.pl @@ -108,8 +108,8 @@ for $rule (@rule_keys) { my ($str, $err) = $nrule->rule_str(); if (!defined($str)) { # rule check failed => return error - print OUT "ERROR: $err\n"; - print STDERR "ERROR: $err\n"; + print OUT "NAT configuration error: $err\n"; + print STDERR "NAT configuration error: $err\n"; exit 5; } |