aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-06-14 20:18:14 +0200
committerRafał Miłecki <rafal@milecki.pl>2021-06-14 20:24:46 +0200
commitc8d8eb9d13fc6fc8b394a620c27995ee71d29c4d (patch)
tree331ba91ace75cc1b4fdbe74c916c3059bca60373
parentf6a03bff5bccdbf9165087bccbb35095903d05c6 (diff)
downloadupstream-c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d.tar.gz
upstream-c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d.tar.bz2
upstream-c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d.zip
base-files: set MAC for bridge ports (devices) instead of bridge itself
This restores the original config_generate behaviour. With MAC set for bridged devices the bridge automatically gets its MAC adjusted (it picks the lowest MAC of bridged devices). This fixes confusing interfaces setup (bridge ports not having custom MAC assigned). Reported-by: Koen Vandeputte <koen.vandeputte@citymesh.com> Fixes: e002179a6d2e ("base-files: simplify setting device MAC") Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rwxr-xr-xpackage/base-files/files/bin/config_generate10
1 files changed, 9 insertions, 1 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 0dca5549e8..b3752c5430 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -114,9 +114,17 @@ generate_network() {
add network device
set network.@device[-1].name='br-$1'
set network.@device[-1].type='bridge'
- set network.@device[-1].macaddr='$macaddr'
EOF
for port in $ports; do uci add_list network.@device[-1].ports="$port"; done
+ [ -n "macaddr" ] && {
+ for port in $ports; do
+ uci -q batch <<-EOF
+ add network device
+ set network.@device[-1].name='$port'
+ set network.@device[-1].macaddr='$macaddr'
+ EOF
+ done
+ }
device=br-$1
type=
macaddr=""