firewall: change the order of IPv4/IPv6 address detection, fixes mixed notation v6...
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 31 May 2010 01:34:47 +0000 (01:34 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 31 May 2010 01:34:47 +0000 (01:34 +0000)
SVN-Revision: 21642

package/firewall/files/lib/config.sh
package/firewall/files/lib/fw.sh

index c21391266a465d1ed41748e8a50e2067b65e47eb..996cef884d14d7fa348c5b72b4e9fb289f3e5e91 100644 (file)
@@ -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}"
index 553642070ca34745dc9e65187cf7393bd0e115e7..86e817182bc7524cd4b0a1b38b39f20c50329994 100644 (file)
@@ -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