Fix conf_overwrite filter removing vlan mgmt entries#253
Open
Erdnusschokolade wants to merge 1 commit into
Open
Fix conf_overwrite filter removing vlan mgmt entries#253Erdnusschokolade wants to merge 1 commit into
Erdnusschokolade wants to merge 1 commit into
Conversation
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 matchedvlan N mgmt— so themanagement entry got dropped whenever a VLAN's membership was re-saved.
One-line guard (
!item.endsWith(" mgmt")) so mgmt entries survive.