commit | aa5c8eee4609bc280ce5b6bb8d16734bf10d54d0 | [log] [tgz] |
---|---|---|
author | developer <developer@mediatek.com> | Mon May 03 14:05:08 2021 +0800 |
committer | developer <developer@mediatek.com> | Mon May 03 16:53:44 2021 +0800 |
tree | e57775cd28a0ffbd33113803c006e56546c5914c | |
parent | 5105943cfed5e0f1085dfde8611afe92da1f9832 [diff] |
[][Add check in setup macaddr flow to reject invalid macaddr] [Description] Add check in setup macaddr flow to reject invalid macaddr [Release-log] N/A Change-Id: I1510727b62ffc3e00fb5bac0567872fb9498ac8e Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/4502696
diff --git a/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network index 2947c26..7820f11 100755 --- a/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network
@@ -39,8 +39,21 @@ lan_mac=$(mtd_get_mac_binary $part_name $lan_mac_offset) wan_mac=$(mtd_get_mac_binary $part_name $wan_mac_offset) - [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" - [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac" + case "$lan_mac" in + 00:00:00:00:00:00);; + ff:ff:ff:ff:ff:ff);; + *) + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" + ;; + esac + + case "$wan_mac" in + 00:00:00:00:00:00);; + ff:ff:ff:ff:ff:ff);; + *) + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac" + ;; + esac } board_config_update