summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-09-10 15:26:25 -0700
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-09-10 15:26:25 -0700
commit38e688a62f8a0e9c15e3af3d46b06ae31602b5e2 (patch)
tree1b007f8351a1af57d2210aeb262ecbf74a38ab0d
parent9ef3bacf8139c09bd0684f448e2dc1ec9216d897 (diff)
downloadvyatta-conntrack-38e688a62f8a0e9c15e3af3d46b06ae31602b5e2.tar.gz
vyatta-conntrack-38e688a62f8a0e9c15e3af3d46b06ae31602b5e2.zip
re-order src/dest rules if multiport used
-rw-r--r--lib/Vyatta/Conntrack/RuleIgnore.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Vyatta/Conntrack/RuleIgnore.pm b/lib/Vyatta/Conntrack/RuleIgnore.pm
index 30cd33d..55a2315 100644
--- a/lib/Vyatta/Conntrack/RuleIgnore.pm
+++ b/lib/Vyatta/Conntrack/RuleIgnore.pm
@@ -49,8 +49,15 @@ sub rule {
$rule .= " -p $self->{_protocol}";
}
}
-
- $rule .= " $srcrule $dstrule ";
+
+ # make sure multiport is always behind single port option
+ if ((grep /multiport/, $srcrule)) {
+ $rule .= " $dstrule $srcrule ";
+ } elsif ((grep /multiport/, $dstrule)) {
+ $rule .= " $srcrule $dstrule ";
+ } else {
+ $rule .= " $srcrule $dstrule ";
+ }
return $rule;
}