MiSTer-devel / Scripts_MiSTer

Miscellaneous Bash scripts for MiSTer
GNU General Public License v3.0
85 stars 43 forks source link

Update mac_address_change.sh #91

Closed Akuma-Git closed 2 years ago

Akuma-Git commented 2 years ago

Regarding: https://misterfpga.org/viewtopic.php?t=3661

  1. The reason hexdump fails is because of not using the hexdump "-v" parameter -v Cause hexdump to display all input data. Without the -v option, any number of groups of output lines, which would be identical to the immediately preceding group of output lines (except for the input offsets), are replaced with a line comprised of a single asterisk.

and therefor the c-style $(( )) arithmetic would fail if a group is replaced with a single asterisk

  1. & 0xFEFFFFFFFFFF | 0x020000000000 should be replaced by & 0xFCFFFFFFFFFF as you want to zero the last two bits, namely Universal vs local (U/L bit) and the Unicast vs multicast (I/G bit), otherwise you will not generate a valid MAC address.

  2. write MAC address in uppercase with the ^^