GL-BE9300 Bug: gl-update-cable-mac.sh incorrectly parses mac_mode period causing repeated WAN reconnects

Device:
GL-BE9300 (Flint 3)

Firmware:
4.9.0

Affected feature:
WAN Ethernet MAC Randomization - periodic mode

Configuration:
network.@device.name='eth0'
network.@device.mac_mode='r10080'

Description:

When WAN MAC randomization is enabled using periodic mode (for example r30, r60, r10080), the script:

/usr/sbin/gl-update-cable-mac.sh

incorrectly parses the period value from mac_mode.

Example:

mac_mode=r10080

Expected:
10080 minutes (7 days)

Actual:
The parsed value is incorrect, causing mac_expire to become invalid or already expired.

As a result, every cron execution runs the MAC update process again, changes the WAN MAC address and triggers a network reload, causing WAN disconnections.

Observed behaviour:

  • WAN reconnect every 30 minutes
  • PPPoE session interruption
  • WAN MAC address changes unexpectedly

Debug evidence:

Command:

sh -x /usr/sbin/gl-update-cable-mac.sh time

Output attached.

Workaround:

Removing the following options stops the issue:

uci delete network.<wan_device>.mac_mode
uci delete network.<wan_device>.mac_expire
uci commit network

After removing these values, the script exits without triggering network reloads.

Possible fix:

The period extraction should only remove the leading "r".

Current logic:

sed 's/.([0-9]+)./\1/'

Possible replacement:

sed 's/^r//'

or:

sed 's/[^0-9]//g'

This issue may affect all periodic MAC randomization modes:
r30
r60
r1440
r10080
etc.

Hi,

Thank you for reporting this issue and for providing the detailed analysis.

We have recorded the issue and submitted it to the relevant development team.
It will be fixed in the new firmware version.

Thank you for your understanding and support.