diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2009-04-09 11:27:31 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2009-04-09 11:27:31 -0700 |
commit | 22ca661c3cd95ef08459b83d010b31bd6e851b67 (patch) | |
tree | 90bf70fd3fabc277faf1a0e55268642d92bfb57f /lib | |
parent | 789bb8a2bbce86b064460ac62fa09c25323d5f44 (diff) | |
download | vyatta-cfg-firewall-22ca661c3cd95ef08459b83d010b31bd6e851b67.tar.gz vyatta-cfg-firewall-22ca661c3cd95ef08459b83d010b31bd6e851b67.zip |
Add ability for firename to select default policy.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Vyatta/IpTables/Rule.pm | 10 |
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 { |