From: Felix Fietkau Date: Sat, 3 Feb 2007 15:50:46 +0000 (+0000) Subject: when adding vlans, not only use vlan*hwaddr, but check vlan*hwname as well (finally... X-Git-Tag: whiterussian_0.9 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=dc5d342c15f9a4d5e2d97ea679ab293dd15ce2bd;p=openwrt%2Fsvn-archive%2Fopenwrt.git when adding vlans, not only use vlan*hwaddr, but check vlan*hwname as well (finally fixes network on wrt54g v1.1) SVN-Revision: 6257 --- diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh index ed44b76750..70b3086849 100755 --- a/openwrt/package/base-files/default/etc/functions.sh +++ b/openwrt/package/base-files/default/etc/functions.sh @@ -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>&- diff --git a/openwrt/package/base-files/default/etc/init.d/S05nvram b/openwrt/package/base-files/default/etc/init.d/S05nvram index 5196d672dc..aa0ce3301e 100755 --- a/openwrt/package/base-files/default/etc/init.d/S05nvram +++ b/openwrt/package/base-files/default/etc/init.d/S05nvram @@ -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