summaryrefslogtreecommitdiff
path: root/templates/firewall/group
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-07-27 14:30:36 -0700
committerStig Thormodsrud <stig@vyatta.com>2010-07-27 15:58:36 -0700
commit5f1dc222ce4021b6a74b9d19b6e4265a00e8eb89 (patch)
tree29dca11f646dcee534af2aab8da6e795f14a784b /templates/firewall/group
parenta6aa2159244af565c93a0d771326141b2bb90be2 (diff)
downloadvyatta-cfg-firewall-5f1dc222ce4021b6a74b9d19b6e4265a00e8eb89.tar.gz
vyatta-cfg-firewall-5f1dc222ce4021b6a74b9d19b6e4265a00e8eb89.zip
Fix 5917: FW: Max characters exceeded for ipset rule when using "set firewall group address-group" command
(cherry picked from commit 37638769fdaf40c5882eef3614e02f0aadbb1bba)
Diffstat (limited to 'templates/firewall/group')
-rw-r--r--templates/firewall/group/address-group/node.tag/address/node.def6
-rw-r--r--templates/firewall/group/port-group/node.tag/port/node.def6
2 files changed, 10 insertions, 2 deletions
diff --git a/templates/firewall/group/address-group/node.tag/address/node.def b/templates/firewall/group/address-group/node.tag/address/node.def
index c62f4dd..389a057 100644
--- a/templates/firewall/group/address-group/node.tag/address/node.def
+++ b/templates/firewall/group/address-group/node.tag/address/node.def
@@ -11,7 +11,11 @@ syntax:expression: exec "sudo /opt/vyatta/sbin/vyatta-ipset.pl \
--member=\"$VAR(@)\"; "
create: tmpgrp=$VAR(../@)-$PPID
- tmpfile="/tmp/$VAR(../@)-$PPID";
+ len=${#tmpgrp}
+ if [ "$len" -gt 31 ]; then
+ tmpgrp=${tmpgrp: -31};
+ fi
+ tmpfile="/tmp/$tmpgrp";
if [ "$COMMIT_SIBLING_POSITION" = "FIRST" ] || \
[ "$COMMIT_SIBLING_POSITION" = "FIRSTLAST" ] ; then
diff --git a/templates/firewall/group/port-group/node.tag/port/node.def b/templates/firewall/group/port-group/node.tag/port/node.def
index c6f3173..de73950 100644
--- a/templates/firewall/group/port-group/node.tag/port/node.def
+++ b/templates/firewall/group/port-group/node.tag/port/node.def
@@ -13,7 +13,11 @@ syntax:expression: exec "sudo /opt/vyatta/sbin/vyatta-ipset.pl \
--member=\"$VAR(@)\"; "
create: tmpgrp=$VAR(../@)-$PPID
- tmpfile="/tmp/$VAR(../@)-$PPID";
+ len=${#tmpgrp}
+ if [ "$len" -gt 31 ]; then
+ tmpgrp=${tmpgrp: -31};
+ fi
+ tmpfile="/tmp/$tmpgrp";
if [ "$COMMIT_SIBLING_POSITION" = "FIRST" ] || \
[ "$COMMIT_SIBLING_POSITION" = "FIRSTLAST" ] ; then