cmd: refuse a management VLAN that cannot exist

"vlan 5000 mgmt" parked the management interface on a VLAN the table
cannot hold, which quietly cuts management off. IDs above 4094 now fall
through to the usage message. 0 still switches the management VLAN off,
which is the documented way to disable it.
This commit is contained in:
d00f
2026-08-08 17:38:10 +02:00
parent 1e19a9abe2
commit 1701d4dc53
+2
View File
@@ -347,6 +347,8 @@ void parse_vlan(void)
return; return;
} }
if (cmd_compare(2, "mgmt")) { if (cmd_compare(2, "mgmt")) {
if (vlan_settings.vlan > 4094)
goto err;
management_vlan = vlan_settings.vlan; management_vlan = vlan_settings.vlan;
if (!vlan_settings.vlan) if (!vlan_settings.vlan)
print_string("Management VLAN disabled\n"); print_string("Management VLAN disabled\n");