From e8d3430ded1d110bed9a3a7173877a830597898e Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 3 Jun 2024 06:18:48 -0500 Subject: [PATCH] do not rely entirely on mac0 --- .../FOS/rootfs_overlay/etc/init.d/S40network | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S40network b/Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S40network index 41684fe..97cea6e 100755 --- a/Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S40network +++ b/Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S40network @@ -52,15 +52,18 @@ for iface in $ifaces; do # NOTE: the link to web is kind of important, just # exiting on dhcp request is not sufficient. if [[ $ustat -eq 0 && $cstat -eq 0 ]]; then - if [[ ! -z $mac0 && ! -z $domacset ]]; then + if [[ ! -z $domacset ]]; then if [[ ! -z $setmacto ]]; then - mac0=$setmacto + # Update the mac address if the DoMACSet flag + # has been raised + ip link set dev $iface down + ip link set dev $iface address $setmacto + ip link set dev $iface up + else + ip link set dev $iface down + ip link set dev $iface address $mac0 + ip link set dev $iface up fi - # Update the mac address if the DoMACSet flag - # has been raised - ip link set dev $iface down - ip link set dev $iface address $mac0 - ip link set dev $iface up fi exit 0 fi