[][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