mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
feat(cli): add mac command to set the management MAC from the config
Add a `mac <aa:bb:cc:dd:ee:ff>` console command (and a bare `mac` to show the current address) that overrides the management MAC at runtime. The address is validated (unicast, globally administered, non-zero OUI) and the static L2 management entry is re-registered so the change applies without a reboot. Because it is a normal command, a line in the startup config persists it across boots: execute_config() runs it before the final static L2 entry and the derived hostname are set up. Also point the keepLink KP-9000-9XHML-X V3.1 machine definition at the factory MAC area (0x1FC000, same location other machines use) so a valid factory MAC is picked up at boot instead of falling back to a locally administered address. The MAC parsing/printing lives in parse_mac()/print_mac() helpers next to parse_ip()/print_ip() so future commands can reuse them, and a memcmp() helper joins the project's own memcpy()/memset() (no libc is linked).
This commit is contained in:
1 parent
6488433584
commit
6616a0c9ce
4 files changed
+109
No files matched your search
@@ -247,6 +247,7 @@ __code const struct machine machine = {
|
||||
.led_mux = {0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0c, 0x09, 0x0d, 0x10,
|
||||
0x11, 0x0e, 0x14, 0x11, 0x12, 0x15, 0x15, 0x16, 0x18, 0x19,
|
||||
0x1a, 0x19, 0x1d, 0x1e, 0x1c, 0x1d, 0x20, 0x21},
|
||||
.mac_flash_offset = 0x1FC000,
|
||||
};
|
||||
|
||||
#elif defined MACHINE_SWGT024_V2_0_MANAGED
|
||||
|
||||
Reference in new issue
Block a user