aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorINAGAKI Hiroshi <musashino.open@gmail.com>2021-05-23 20:30:58 +0900
committerRafał Miłecki <rafal@milecki.pl>2021-05-27 11:39:15 +0200
commit77d96e925fef1010f3d94a7cc722d23efd243b1e (patch)
treed892a394ee03a9883b6cdbcdff89ba548bcdb166 /package/base-files
parentfc605c01f6d1fd8e2aa8ede83b03ae87f12524a9 (diff)
downloadupstream-77d96e925fef1010f3d94a7cc722d23efd243b1e.tar.gz
upstream-77d96e925fef1010f3d94a7cc722d23efd243b1e.tar.bz2
upstream-77d96e925fef1010f3d94a7cc722d23efd243b1e.zip
base-files: fix configuration generation of network if "bridge" exists
After the commit 43fc720657c6e3b30c6ed89d7227ee6e646c158b ("base-files: generate "device UCI type section for bridge"), the wrong network configuration is generated for the devices that already have the bridge device section for VLAN, such as the devices in realtek target. As a result, the bridge device by additional "device" section is specified to the "ports" option in the "bridge-vlan" section and netifd shuts down the switch and the ethernet when the network service started. Fixes: 43fc720657 ("base-files: generate "device" UCI type section for bridge") Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> [rmilecki: use $ports for generate_bridge_vlan argument] Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 8cc4e87a2f81df02dbe481759ae6c36cf056c13b)
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/bin/config_generate5
1 files changed, 3 insertions, 2 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 604c49a709..be688a4ba3 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -109,7 +109,7 @@ generate_network() {
ports="$ifname"
}
- [ -n "$ports" ] && {
+ [ -n "$ports" -a -z "$bridge" ] && {
uci -q batch <<-EOF
add network device
set network.@device[-1].name='br-$1'
@@ -123,11 +123,12 @@ generate_network() {
}
[ -n "$bridge" ] && {
+ [ -z "$ports" ] && ports="$ifname"
if [ -z "$vlan" ]; then
bridge_vlan_id=$((bridge_vlan_id + 1))
vlan=$bridge_vlan_id
fi
- generate_bridge_vlan $1 $bridge "$ifname" $vlan
+ generate_bridge_vlan $1 $bridge "$ports" $vlan
ifname=$bridge.$vlan
type=""
}