Browse Source

firewall: change the order of IPv4/IPv6 address detection, fixes mixed notation v6 improperly detected as v4 address

SVN-Revision: 21642
Jo-Philipp Wich 15 years ago
parent
commit
a756114e59
2 changed files with 2 additions and 2 deletions
  1. 1 1
      package/firewall/files/lib/config.sh
  2. 1 1
      package/firewall/files/lib/fw.sh

+ 1 - 1
package/firewall/files/lib/config.sh

@@ -87,8 +87,8 @@ config_get_ipaddr() {
 
 	local vers=
 	case "$addr" in
-		*.*) vers=4; mask="${mask:-32}" ;;
 		*:*) vers=6; mask="${mask:-128}" ;;
+		*.*) vers=4; mask="${mask:-32}" ;;
 	esac
 	
 	export ${NO_EXPORT:+-n} -- "${varn}=${addr}"

+ 1 - 1
package/firewall/files/lib/fw.sh

@@ -51,8 +51,8 @@ fw__exec() { # <action> <family> <table> <chain> <target> <position> { <rules> }
 		shift
 		while [ "$1" != '}' ]; do
 			case "$1" in
-				*.*.*.*) ip4=1 ;;
 				*:*) ip6=1 ;;
+				*.*.*.*) ip4=1 ;;
 			esac
 			shift
 		done