diff options
-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; } |