mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Fix conf_overwrite filter removing vlan mgmt entries
The vlan/mgmt lookahead split (commit dcc60c3) correctly separated the
patterns so that `vlan N mgmt` and `vlan N <members>` 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.
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user