[package] 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 15237ff..ea407f0 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 aff6641..ed6a4b1 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"
 }