From: Jo-Philipp Wich Date: Wed, 25 Nov 2015 15:43:33 +0000 (+0000) Subject: base-files: config_generate: properly handle multiple switches X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=63c2111e86253763ed9409638db57e9c063f476c;p=openwrt%2Fstaging%2Fdangole.git base-files: config_generate: properly handle multiple switches Signed-off-by: Jo-Philipp Wich SVN-Revision: 47646 --- diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 40d70475a4..29fec8e946 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -172,6 +172,16 @@ calculate_switch_vlans() { eval device="\$dev$((vlan_off++ % n_cpu))" [ $n_vlan -gt $n_cpu ] && device="$device.$vlan_off" + # quirk: append ifnames for subsequent switches + case "$switch" in switch[1-9]) + local prev_devs="$(uci -q get "network.$role.ifname")" + if echo "$prev_devs" | grep -wq "$device"; then + device="$prev_devs" + else + device="$prev_devs $device" + fi + ;; esac + uci -q batch <<-EOF delete network.$role set network.$role='interface'