Skip to content

Fix conf_overwrite filter removing vlan mgmt entries#253

Open
Erdnusschokolade wants to merge 1 commit into
logicog:mainfrom
Erdnusschokolade:fix/vlan-mgmt-filter
Open

Fix conf_overwrite filter removing vlan mgmt entries#253
Erdnusschokolade wants to merge 1 commit into
logicog:mainfrom
Erdnusschokolade:fix/vlan-mgmt-filter

Conversation

@Erdnusschokolade
Copy link
Copy Markdown
Contributor

Follow-up to #237 (the vlan/mgmt lookahead fix). The pattern separation
was correct, but the conf_overwrite filter still used
startsWith("vlan N "), which also matched vlan N mgmt — so the
management entry got dropped whenever a VLAN's membership was re-saved.

One-line guard (!item.endsWith(" mgmt")) so mgmt entries survive.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant