From 592b9033054984db67a6475022441911fb3b3894 Mon Sep 17 00:00:00 2001 From: Erdnusschokolade <96622762+Erdnusschokolade@users.noreply.github.com> Date: Tue, 2 Jun 2026 22:52:06 +0200 Subject: [PATCH] Fix conf_overwrite filter removing vlan mgmt entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vlan/mgmt lookahead split (commit dcc60c3) correctly separated the patterns so that `vlan N mgmt` and `vlan N ` match different conf_overwrite entries. But the filter that applies the overwrite still used `item.startsWith(matchStr + " ")` with matchStr = "vlan N", which also matches "vlan N mgmt" — so the management entry was removed whenever the VLAN's membership definition was re-saved. Example: with both `vlan 44 management 2t 4t 5 6t` and `vlan 44 mgmt` in the config, changing the membership dropped `vlan 44 mgmt` entirely. Added a `!item.endsWith(" mgmt")` guard so management entries survive the filter. No reordering is needed: `vlan N mgmt` only sets the global management_vlan variable (cmd_parser.c) and does not depend on the VLAN table entry existing, so its position in the config is irrelevant. --- html/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/config.js b/html/config.js index dd8512b..b9e2e9c 100644 --- a/html/config.js +++ b/html/config.js @@ -71,7 +71,7 @@ function parseConf(s){ let m = line.match(x); let matchStr = m[0]; configuration = configuration.filter(item => - !(item === matchStr || item.startsWith(matchStr + " "))); + !(item === matchStr || (item.startsWith(matchStr + " ") && !item.endsWith(" mgmt")))); break; } }