aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-11-25 15:43:33 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-11-25 15:43:33 +0000
commit9f9e4d57f9bf0d05a6051482f59a7634a5814459 (patch)
treeb06c717c3f61575446c451cb879f1b12687fef50
parent360b259ae4fe47052fe686afb1e69a10ff33aa94 (diff)
downloadmaster-187ad058-9f9e4d57f9bf0d05a6051482f59a7634a5814459.tar.gz
master-187ad058-9f9e4d57f9bf0d05a6051482f59a7634a5814459.tar.bz2
master-187ad058-9f9e4d57f9bf0d05a6051482f59a7634a5814459.zip
base-files: config_generate: properly handle multiple switches
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47646 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/bin/config_generate10
1 files changed, 10 insertions, 0 deletions
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'