summaryrefslogtreecommitdiff
path: root/lib/Vyatta/IpTables/Rule.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/IpTables/Rule.pm')
-rw-r--r--lib/Vyatta/IpTables/Rule.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Vyatta/IpTables/Rule.pm b/lib/Vyatta/IpTables/Rule.pm
index 46925ac..46f3acf 100644
--- a/lib/Vyatta/IpTables/Rule.pm
+++ b/lib/Vyatta/IpTables/Rule.pm
@@ -122,10 +122,18 @@ sub new {
}
sub setupDummy {
- my $self = shift;
+ my ($self, $level) = @_;
+
%{$self} = %dummy_rule;
$src = new Vyatta::IpTables::AddressFilter;
$dst = new Vyatta::IpTables::AddressFilter;
+
+ # set the default policy
+ my $config = new Vyatta::Config;
+ $config->setLevel("$level");
+ my $policy = $config->returnOrigValue('default-policy');
+ $policy = 'drop' if ! defined $policy;
+ $self->{_action} = $policy;
}
sub setup_base {