diff options
author | INAGAKI Hiroshi <musashino.open@gmail.com> | 2021-05-23 20:30:58 +0900 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2021-05-24 09:09:00 +0200 |
commit | 8cc4e87a2f81df02dbe481759ae6c36cf056c13b (patch) | |
tree | ee12309d5f828bcd074eefdec885bc8f30931e75 /package/base-files/files | |
parent | 7a90ad3c431031191afe51b163bf97d3ec820d54 (diff) | |
download | upstream-8cc4e87a2f81df02dbe481759ae6c36cf056c13b.tar.gz upstream-8cc4e87a2f81df02dbe481759ae6c36cf056c13b.tar.bz2 upstream-8cc4e87a2f81df02dbe481759ae6c36cf056c13b.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>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-x | package/base-files/files/bin/config_generate | 5 |
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="" } |