You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p')
$part is the mtd containing the uboot environment.
When uboot writes its env it only erases sectors it needs to. If you delete a lot of env variables, later sectors can still contain old data. strings will read from those sectors and sed will potentially see multiple copies of the ethaddr variable. It can then output multiple copies of the ethaddr, which causes macaddr_canonicalize to reject the input because it is longer than 17 characters
A simple fix would be to do something like:
mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p' | head -n 1)
There may be a better way with some sed magic.
The text was updated successfully, but these errors were encountered:
ali1234:
In /lib/functions/system.sh is the code:
$part is the mtd containing the uboot environment.
When uboot writes its env it only erases sectors it needs to. If you delete a lot of env variables, later sectors can still contain old data. strings will read from those sectors and sed will potentially see multiple copies of the ethaddr variable. It can then output multiple copies of the ethaddr, which causes macaddr_canonicalize to reject the input because it is longer than 17 characters
A simple fix would be to do something like:
There may be a better way with some sed magic.
The text was updated successfully, but these errors were encountered: