when adding vlans, not only use vlan*hwaddr, but check vlan*hwname as well (finally...
authorFelix Fietkau <nbd@openwrt.org>
Sat, 3 Feb 2007 15:50:46 +0000 (15:50 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 3 Feb 2007 15:50:46 +0000 (15:50 +0000)
SVN-Revision: 6257

openwrt/package/base-files/default/etc/functions.sh
openwrt/package/base-files/default/etc/init.d/S05nvram

index ed44b76750160c289225f327c2876fb4c03d0b3c..70b30868491645fb362c3215f5eca34980db485a 100755 (executable)
@@ -17,6 +17,7 @@ if_valid () (
 
       vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
       debug "# vlan$i => $vif"
+         [ -n "$vif" ] || vif=$(ifconfig -a | awk '/^eth'${hw##et}'/ {print $1; exit}' IGNORECASE=1)
 
       $DEBUG ifconfig $vif up
       $DEBUG vconfig add $vif $i 2>&-
index 5196d672dc079c28672b468ee71842988e45aa86..aa0ce3301e13e9b787a26d09c028ab82666fe2d8 100755 (executable)
@@ -79,10 +79,11 @@ nvram_default lan_proto static
        remap eth0 vlan2
        remap eth1 vlan1
        nvram_default vlan1hwname "et0"
-       nvram_default vlan1ports "0 5"
        nvram_default vlan2hwname "et0"
-       nvram_default vlan2ports "1 2 3 4 5*"
-       nvram_default lan_ifnames "vlan2 eth2"
+       nvram_default lan_ifnames "vlan0 eth2"
+       nvram get lan_ifnames | grep vlan2 >/dev/null && {
+               nvram_default vlan2ports "1 2 3 4 5*"
+       }
 }
 
 # hacks for asus wl-500g deluxe