firewall: prevent duplicate values in interface state vars
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 30 Mar 2011 20:29:17 +0000 (20:29 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 30 Mar 2011 20:29:17 +0000 (20:29 +0000)
SVN-Revision: 26382

package/firewall/Makefile
package/firewall/files/lib/core_interface.sh

index 15237ff8f44b00fdd9be7ff83ab5cc20bfcb12b9..ea407f081bb1c49b47941ee0a8b8f99d76349961 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=firewall
 
 PKG_VERSION:=2
-PKG_RELEASE:=23
+PKG_RELEASE:=24
 
 include $(INCLUDE_DIR)/package.mk
 
index aff66418079f0934530c75907217e478d8f39f69..ed6a4b150fd9414f0a229903445d86b30fc1f375 100644 (file)
@@ -4,7 +4,10 @@ fw__uci_state_add() {
        local var="$1"
        local item="$2"
 
-       local val="$(uci_get_state firewall core $var)"
+       local val=" $(uci_get_state firewall core $var) "
+       val="${val// $item / }"
+       val="${val# }"
+       val="${val% }"
        uci_set_state firewall core $var "${val:+$val }$item"
 }