From 77edc93e2a7679c864ae4e57791a7ed36e3c47e4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 22 Oct 2011 20:11:25 +0000 Subject: [PATCH] [package] firewall: fix possible expansion of "*" when rules with "option src *" are processed SVN-Revision: 28527 --- package/firewall/Makefile | 2 +- package/firewall/files/lib/fw.sh | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/package/firewall/Makefile b/package/firewall/Makefile index 749f04a4b1..b0b946fd07 100644 --- a/package/firewall/Makefile +++ b/package/firewall/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firewall PKG_VERSION:=2 -PKG_RELEASE:=36 +PKG_RELEASE:=37 include $(INCLUDE_DIR)/package.mk diff --git a/package/firewall/files/lib/fw.sh b/package/firewall/files/lib/fw.sh index bf7156e8ce..a8a7911494 100644 --- a/package/firewall/files/lib/fw.sh +++ b/package/firewall/files/lib/fw.sh @@ -211,12 +211,17 @@ fw_get_family_mode() { local _mode="$4" local _ipv4 _ipv6 - [ -n "$FW_ZONES4$FW_ZONES6" ] && { - list_contains FW_ZONES4 $_zone && _ipv4=1 || _ipv4=0 - list_contains FW_ZONES6 $_zone && _ipv6=1 || _ipv6=0 + [ "$_zone" != "*" ] && { + [ -n "$FW_ZONES4$FW_ZONES6" ] && { + list_contains FW_ZONES4 "$_zone" && _ipv4=1 || _ipv4=0 + list_contains FW_ZONES6 "$_zone" && _ipv6=1 || _ipv6=0 + } || { + _ipv4=$(uci_get_state firewall core "${_zone}_ipv4" 0) + _ipv6=$(uci_get_state firewall core "${_zone}_ipv6" 0) + } } || { - _ipv4=$(uci_get_state firewall core ${_zone}_ipv4 0) - _ipv6=$(uci_get_state firewall core ${_zone}_ipv6 0) + _ipv4=1 + _ipv6=1 } case "$_hint:$_ipv4:$_ipv6" in -- 2.30.2