summaryrefslogtreecommitdiff
path: root/scripts/VyattaNatRule.pm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/VyattaNatRule.pm')
-rw-r--r--scripts/VyattaNatRule.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/VyattaNatRule.pm b/scripts/VyattaNatRule.pm
index bd0c598..2e57df6 100644
--- a/scripts/VyattaNatRule.pm
+++ b/scripts/VyattaNatRule.pm
@@ -211,7 +211,9 @@ sub rule_str {
$to_src .= "$self->{_outside_addr}->{_port}";
}
- if ($to_src ne "") {
+ if ($self->{_exclude}) {
+ # outside-address has no effect for "exclude" rules
+ } elsif ($to_src ne '') {
if ($self->{_type} eq "masquerade") {
$rule_str .= " --to-ports $to_src";
} else {
@@ -274,7 +276,9 @@ sub rule_str {
$to_dst .= ":$self->{_inside_addr}->{_port}";
}
- if ($to_dst ne " --to-destination ") {
+ if ($self->{_exclude}) {
+ # inside-address has no effect for "exclude" rules
+ } elsif ($to_dst ne ' --to-destination ') {
$rule_str .= $to_dst;
} else {
return (undef, "inside-address not specified");