From 9e61589926f6801c318406d373d5b9d01922e12e Mon Sep 17 00:00:00 2001 From: Marian Tudosoiu Date: Fri, 23 Mar 2018 11:00:49 +0200 Subject: Task T35 change to solve port-group issue --- lib/Vyatta/IpTables/IpSet.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm index cee7935..5258773 100755 --- a/lib/Vyatta/IpTables/IpSet.pm +++ b/lib/Vyatta/IpTables/IpSet.pm @@ -190,11 +190,13 @@ sub create { my $ipset_param = $grouptype_hash{$self->{_type}}; return "Error: invalid group type\n" if !defined $ipset_param; + my $cmd = "ipset -N $self->{_name} $ipset_param family $self->{_family}"; + if ($self->{_type} eq 'port') { $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 -- cgit v1.2.3