summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-03-17 12:42:05 -0700
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-03-17 12:42:05 -0700
commit0f71f18eaec8643d8f78b95bb1657734b3f5b368 (patch)
treec24a4340feefbba8b99a9f0e269f4cd75f324a64
parentec409015bfa33a4e33b7437f3ce7093c2b58d21a (diff)
downloadvyatta-conntrack-0f71f18eaec8643d8f78b95bb1657734b3f5b368.tar.gz
vyatta-conntrack-0f71f18eaec8643d8f78b95bb1657734b3f5b368.zip
delete nfct fixed, use only policy name, modified deletion function
-rw-r--r--lib/Vyatta/Conntrack/RuleCT.pm8
-rw-r--r--scripts/vyatta-conntrack-timeouts.pl4
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/Vyatta/Conntrack/RuleCT.pm b/lib/Vyatta/Conntrack/RuleCT.pm
index ee52ce3..bab941e 100644
--- a/lib/Vyatta/Conntrack/RuleCT.pm
+++ b/lib/Vyatta/Conntrack/RuleCT.pm
@@ -185,10 +185,14 @@ sub print {
# return a string that has the nfct-timeout command to create
# a timeout policy.
sub get_policy_command {
- my ($self ) = @_;
+ my ($self, $is_delete) = @_;
my $command;
my @level_nodes = split (' ', $self->{_comment});
- $command .= "policy_$level_nodes[2]_$level_nodes[5] inet";
+ $command .= "policy_$level_nodes[2]_$level_nodes[5] ";
+ if ($is_delete eq "delete") {
+ return $command;
+ }
+ $command .= " inet";
if ($self->{_protocol} eq 'tcp') {
$command .= " tcp";
if ($self->{_tcp}->{_close}) {
diff --git a/scripts/vyatta-conntrack-timeouts.pl b/scripts/vyatta-conntrack-timeouts.pl
index 81e5fff..8fe2e39 100644
--- a/scripts/vyatta-conntrack-timeouts.pl
+++ b/scripts/vyatta-conntrack-timeouts.pl
@@ -127,7 +127,7 @@ sub handle_rule_creation {
do_protocol_check($rule);
$node->setup("system conntrack timeout custom rule $rule");
$rule_string = $node->rule();
- $timeout_policy = $node->get_policy_command(); #nfct-timeout command string
+ $timeout_policy = $node->get_policy_command("add"); #nfct-timeout command string
apply_timeout_policy($rule_string, $timeout_policy);
}
@@ -155,7 +155,7 @@ sub handle_rule_deletion {
my ($rule_string, $timeout_policy);
$node->setupOrig("system conntrack timeout custom rule $rule");
$rule_string = $node->rule();
- $timeout_policy = $node->get_policy_command(); #nfct-timeout command string
+ $timeout_policy = $node->get_policy_command("delete"); #nfct-timeout command string
remove_timeout_policy($rule_string, $timeout_policy);
}