diff options
| author | Daniil Baturin <daniil@baturin.org> | 2018-03-12 18:28:32 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-12 18:28:32 +0700 |
| commit | 98d47b93bbac7abcc26f073329d4f1180deb47c1 (patch) | |
| tree | 84a8a5e0fcb6d98b73880f3afd5a1567883679a0 /lib/Vyatta/IpTables/IpSet.pm | |
| parent | 4c12861706e5a9d6f500dd00c71ad58e9c7375c1 (diff) | |
| parent | 4e3ea201d7902d9a0641bbecf42d7e837595e01b (diff) | |
| download | vyatta-cfg-firewall-98d47b93bbac7abcc26f073329d4f1180deb47c1.tar.gz vyatta-cfg-firewall-98d47b93bbac7abcc26f073329d4f1180deb47c1.zip | |
Merge pull request #7 from mtudosoiu/current
Task T35 - add support for IPv6 firewall adddress and network groups
Diffstat (limited to 'lib/Vyatta/IpTables/IpSet.pm')
| -rwxr-xr-x | lib/Vyatta/IpTables/IpSet.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm index ea9bc8d..e293240 100755 --- a/lib/Vyatta/IpTables/IpSet.pm +++ b/lib/Vyatta/IpTables/IpSet.pm @@ -35,6 +35,7 @@ use warnings; my %fields = ( _name => undef, _type => undef, # vyatta group type, not ipset type + _family => undef, _exists => undef, _negate => undef, _debug => undef, @@ -65,7 +66,7 @@ sub INT_handler { $SIG{'INT'} = 'INT_handler'; sub new { - my ($that, $name, $type) = @_; + my ($that, $name, $type, $family) = @_; my $class = ref($that) || $that; my $self = {%fields,}; @@ -75,6 +76,7 @@ sub new { } $self->{_name} = $name; $self->{_type} = $type; + $self->{_family} = $family; bless $self, $class; return $self; @@ -192,7 +194,7 @@ sub create { $ipset_param .= ' --from 1 --to 65535'; } - my $cmd = "ipset -N $self->{_name} $ipset_param"; + my $cmd = "ipset -N $self->{_name} $ipset_param family $self->{_family}"; my $rc = $self->run_cmd($cmd); return "Error: call to ipset failed [$rc]" if $rc; return; # undef |
