Revision history for Perl extension IPTables::ChainMgr.
+1.1 Tue Feb 28 21:15:11 2012
+ - Added META.{yml,json} files similarly to fixing this bug filed against
+ IPTables::Parse:
+ https://rt.cpan.org/Ticket/Display.html?id=75366
+ - Minor bug fix to ensure not to look for 'extended' hash keys in returned
+ IPTables::Parse data without an existence check first.
+ - Added the ability to specify 'ip6tables' when instantiating an
+ IPTables::ChainMgr object via 'new'.
+ - Updated license to the Artistic license.
+
1.0 Mon Feb 27 21:56:44 2012
- Added 'ctstate' and 'state' keys to extended hashes for find_ip_rule()
and add_ip_rule(). This commit fixes:
my %args = @_;
my $self = {
- _iptables => $args{'iptables'} || '/sbin/iptables',
+ _iptables => $args{'iptables'} || $args{'ip6tables'} || '/sbin/iptables',
_iptout => $args{'iptout'} || '/tmp/ipt.out',
_ipterr => $args{'ipterr'} || '/tmp/ipt.err',
_ipt_alarm => $args{'ipt_alarm'} || 30,
ctstate
)) {
if (defined $extended_href->{$key}) {
- if ($key eq 'state' or $key eq 'ctstate') {
- ### make sure that state ordering as reported
- ### by iptables is accounted for vs. what was
- ### supplied to the module
- unless (&state_compare($extended_href->{$key},
- $rule_href->{$key})) {
- $found = 0;
- last;
+ if (defined $rule_href->{$key}) {
+ if ($key eq 'state' or $key eq 'ctstate') {
+ ### make sure that state ordering as reported
+ ### by iptables is accounted for vs. what was
+ ### supplied to the module
+ unless (&state_compare($extended_href->{$key},
+ $rule_href->{$key})) {
+ $found = 0;
+ last;
+ }
+ } else {
+ unless ($extended_href->{$key}
+ eq $rule_href->{$key}) {
+ $found = 0;
+ last;
+ }
}
} else {
- unless ($extended_href->{$key}
- eq $rule_href->{$key}) {
- $found = 0;
- last;
- }
+ $found = 0;
+ last;
}
}
}
my $ipt_bin = '/sbin/iptables'; # can set this to /sbin/ip6tables
my %opts = (
- 'iptables' => $ipt_bin,
+ 'iptables' => $ipt_bin, # can specify 'ip6tables' hash key instead
'iptout' => '/tmp/iptables.out',
'ipterr' => '/tmp/iptables.err',
'debug' => 0,
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2005-2012 by Michael Rash
+Copyright (C) 2005-2012 Michael Rash. All rights reserved.
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.8.5 or,
-at your option, any later version of Perl 5 you may have available.
+This module is free software. You can redistribute it and/or
+modify it under the terms of the Artistic License 2.0. More information
+can be found here: http://www.perl.com/perl/misc/Artistic.html
+This program is distributed "as is" in the hope that it will be useful,
+but without any warranty; without even the implied warranty of
+merchantability or fitness for a particular purpose.
=cut