summaryrefslogtreecommitdiff
path: root/scripts/firewall/VyattaIpTablesRule.pm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/firewall/VyattaIpTablesRule.pm')
-rw-r--r--scripts/firewall/VyattaIpTablesRule.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/firewall/VyattaIpTablesRule.pm b/scripts/firewall/VyattaIpTablesRule.pm
index c2174c4..a4ec902 100644
--- a/scripts/firewall/VyattaIpTablesRule.pm
+++ b/scripts/firewall/VyattaIpTablesRule.pm
@@ -210,6 +210,12 @@ sub rule {
return ($err_str, ) if (!defined($srcrule));
($dstrule, $err_str) = $dst->rule();
return ($err_str, ) if (!defined($dstrule));
+ if ((grep /multiport/, $srcrule) || (grep /multiport/, $dstrule)) {
+ if ((grep /sport/, $srcrule) && (grep /dport/, $dstrule)) {
+ return ('Cannot specify multiple ports when both '
+ . 'source and destination ports are specified', );
+ }
+ }
$rule .= " $srcrule $dstrule ";
my $chain = $self->{_name};