summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Conntrack
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-03-16 21:03:51 -0700
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-03-16 21:03:51 -0700
commitb4c313d953660b8a70ccfda0b260fd81a6089976 (patch)
treeccde995e180aaf5ac594328aba551b2356405ad9 /lib/Vyatta/Conntrack
parentb791c5f35b7723c139b83b492dd20406cdd42784 (diff)
downloadvyatta-conntrack-b4c313d953660b8a70ccfda0b260fd81a6089976.tar.gz
vyatta-conntrack-b4c313d953660b8a70ccfda0b260fd81a6089976.zip
use add instead of create, use inet, pre-pend protocol to iptables rule
Diffstat (limited to 'lib/Vyatta/Conntrack')
-rw-r--r--lib/Vyatta/Conntrack/RuleCT.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Vyatta/Conntrack/RuleCT.pm b/lib/Vyatta/Conntrack/RuleCT.pm
index 9953291..5c59b93 100644
--- a/lib/Vyatta/Conntrack/RuleCT.pm
+++ b/lib/Vyatta/Conntrack/RuleCT.pm
@@ -74,6 +74,11 @@ sub rule {
Vyatta::Config::outputError(["Conntrack"], "Conntrack config error: $err_str");
exit 1;
}
+ if ($self->{_protocol} = "tcp") {
+ $rule .= " -p tcp";
+ } elsif ($self->{_protocol} = "udp") {
+ $rule .= " -p udp";
+ }
$rule .= " $srcrule $dstrule ";
return $rule;
}
@@ -181,7 +186,7 @@ sub get_policy_command {
my ($self ) = @_;
my $command;
my @level_nodes = split (' ', $self->{_comment});
- $command .= "policy_$level_nodes[2]_$level_nodes[5]";
+ $command .= "policy_$level_nodes[2]_$level_nodes[5] inet";
if ($self->{_protocol} eq 'tcp') {
$command .= " tcp";
if ($self->{_tcp}->{_close}) {