From fd21d64fe8fbc54c11789d0212c2636c2963ab11 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 3 Feb 2007 15:50:46 +0000 Subject: [PATCH] when adding vlans, not only use vlan*hwaddr, but check vlan*hwname as well (finally fixes network on wrt54g v1.1) SVN-Revision: 6257 --- openwrt/package/base-files/default/etc/functions.sh | 1 + openwrt/package/base-files/default/etc/init.d/S05nvram | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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 -- 2.30.2