aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-11-30 12:32:12 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-11-30 12:32:12 +0000
commit73a4e0334cf332a381b3297a22caad005c90f320 (patch)
treee310ab49fee3d3b35ed8c744f26b64c1d752cfdb /package/base-files/files/bin
parent60b01f432b937dda75c8aa7177ca3dd25f3e33c0 (diff)
downloadupstream-73a4e0334cf332a381b3297a22caad005c90f320.tar.gz
upstream-73a4e0334cf332a381b3297a22caad005c90f320.tar.bz2
upstream-73a4e0334cf332a381b3297a22caad005c90f320.zip
base-files: uci-defaults-new, config_generate: allow force tagged cpu ports
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47679
Diffstat (limited to 'package/base-files/files/bin')
-rwxr-xr-xpackage/base-files/files/bin/config_generate8
1 files changed, 5 insertions, 3 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 6da386faff..45dcd71616 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -173,7 +173,8 @@ calculate_switch_vlans() {
if [ "$role" != "$prev_role" ]; then
if [ -n "$vlan_ports" ]; then
let cpu_port="cpu$((vlan_off % n_cpu))"
- [ $n_vlan -gt $n_cpu ] && cpu_port="${cpu_port}t"
+ let need_tag="tag$((vlan_off % n_cpu))"
+ [ $n_vlan -gt $n_cpu -o $need_tag -eq 1 ] && cpu_port="${cpu_port}t"
uci -q batch <<-EOF
add network switch_vlan
@@ -198,8 +199,9 @@ calculate_switch_vlans() {
# autogenerate interfaces
vlan_off=0; while [ $vlan_off -lt $n_vlan ]; do
eval role="\$role$((vlan_off))"
- eval device="\$dev$((vlan_off++ % n_cpu))"
- [ $n_vlan -gt $n_cpu ] && device="$device.$vlan_off"
+ eval device="\$dev$((vlan_off % n_cpu))"
+ let need_tag="tag$((vlan_off++ % n_cpu))"
+ [ $n_vlan -gt $n_cpu -o $need_tag -eq 1 ] && device="$device.$vlan_off"
# quirk: append ifnames for subsequent switches
case "$switch" in switch[1-9])