summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Tudosoiu <marian.tudosoiu@1and1.ro>2018-03-23 11:00:49 +0200
committerMarian Tudosoiu <marian.tudosoiu@1and1.ro>2018-03-23 11:00:49 +0200
commit9e61589926f6801c318406d373d5b9d01922e12e (patch)
treedbe11fa37caf934f3a641d7c4b39966a4672440f
parent1d21300885e606ec9e8da2b9a9b7af898d896a24 (diff)
downloadvyatta-cfg-firewall-9e61589926f6801c318406d373d5b9d01922e12e.tar.gz
vyatta-cfg-firewall-9e61589926f6801c318406d373d5b9d01922e12e.zip
Task T35 change to solve port-group issue
-rwxr-xr-xlib/Vyatta/IpTables/IpSet.pm4
-rw-r--r--templates/firewall/group/port-group/node.def2
2 files changed, 4 insertions, 2 deletions
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
diff --git a/templates/firewall/group/port-group/node.def b/templates/firewall/group/port-group/node.def
index 1484be2..729165f 100644
--- a/templates/firewall/group/port-group/node.def
+++ b/templates/firewall/group/port-group/node.def
@@ -16,6 +16,6 @@ syntax:expression: pattern $VAR(@) "^[^|;&$<>]*$" ; \
"Firewall group name cannot contain shell punctuation"
end: if sudo /opt/vyatta/sbin/vyatta-ipset.pl --action=update-set \
- --set-name="$VAR(@)" --set-type=port; then
+ --set-name="$VAR(@)" --set-type=port --set-family=inet; then
${vyatta_sbindir}/vyatta-firewall-trap.pl --level="firewall group port-group $VAR(@)"
fi