diff options
| author | Jan Hoffmann | 2026-01-22 19:21:35 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2026-02-10 00:39:52 +0000 |
| commit | 0686fed2b40512bfa0fa859433fe533b0260f18c (patch) | |
| tree | e4dc83dd7b96a1b96b56619b01d4bd6d27081fcd | |
| parent | f27f3e7f233aa869935015219cb57d1377b646c2 (diff) | |
| download | openwrt-0686fed2b40512bfa0fa859433fe533b0260f18c.tar.gz | |
realtek: don't implicitly configure port MAC addresses
Currently, the 02_network script always configures MAC addresses for
each individual LAN port unless "lan_mac_start" is set to "skip". This
behaviour can be unexpected, and is also somewhat broken, as it even
continues to do so when "lan_mac_start" is empty.
Change it to only do the configuration if "lan_mac_start" is non-empty,
and also remove the fallback to "lan_mac", making this more obvious and
less error-prone.
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/21644
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
| -rw-r--r-- | target/linux/realtek/base-files/etc/board.d/02_network | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 32b41da0a9..f08579281e 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -60,6 +60,7 @@ realtek_setup_macs() xikestor,sks8300-12e2t2x) label_mac=$(get_mac_label) lan_mac="$label_mac" + lan_mac_start=$lan_mac ;; hpe,1920-8g|\ hpe,1920-8g-poe-65w|\ @@ -83,26 +84,29 @@ realtek_setup_macs() plasmacloud,psx8|\ plasmacloud,psx10|\ plasmacloud,psx28) - lan_mac_start=skip lan_mac="$(get_mac_label)" ;; tplink,tl-st1008f-v2|\ zyxel,xgs1010-12-a1) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) [ -z "$lan_mac" ] || [ "$lan_mac" = "00:e0:4c:00:00:00" ] && lan_mac=$(macaddr_random) + lan_mac_start=$lan_mac ;; xikestor,sks8300-8x) lan_mac=$(mtd_get_mac_binary board-info 0x1f1) + lan_mac_start=$lan_mac ;; xikestor,sks8310-8x) lan_mac=$(mtd_get_mac_binary factory 0x80) label_mac="$lan_mac" + lan_mac_start=$lan_mac ;; *) lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start) lan_mac_end=$(mtd_get_mac_ascii u-boot-env2 mac_end) label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) [ -z "$lan_mac" ] && lan_mac=$label_mac + lan_mac_start=$lan_mac ;; esac @@ -110,8 +114,7 @@ realtek_setup_macs() [ -n "$lan_mac" ] && ucidef_set_bridge_mac "$lan_mac" [ -n "$lan_mac" ] && ucidef_set_network_device_mac eth0 $lan_mac - [ -z "$lan_mac_start" -a -n "$lan_mac" ] && lan_mac_start=$lan_mac - [ "$lan_mac_start" != "skip" ] && realtek_setup_macs_lan "$lan_list" "$lan_mac_start" "$lan_mac_end" + [ -n "$lan_mac_start" ] && realtek_setup_macs_lan "$lan_list" "$lan_mac_start" "$lan_mac_end" [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac } |