[lldp]: Fix remote management address cache updates - #386
Open
lrt950 wants to merge 1 commit into
Open
Conversation
Signed-off-by: lrt950 <37255967+lrt950@users.noreply.github.com>
|
|
Collaborator
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
lrt950
marked this pull request as ready for review
July 29, 2026 09:02
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
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.
- What I did
lldpRemManAddrTablecache entries after LLDP neighbor updates.- How I did it
LLDPRemManAddrUpdaterpreviously appended every SET result toif_range, so repeated updates accumulated duplicate rows and changes to the time mark or management address left old rows visible. The DEL path also comparedif_indexwithsub_oid[0], but index position 0 is the LLDP time mark; the interface index is at position 1.The updater now builds the complete new row set for one interface first, then replaces all cached rows for that interface in one assignment. SET and DEL notifications both refresh from the current DB state, which also handles delete/recreate races without duplicating cache invalidation logic.
- How to verify it
python3 -m pytest tests/test_lldp.py -qpython3 -m compileall -q src tests/test_lldp.pygit diff --checkThe local LLDP test run completed with
22 passed, 3 subtests passed. The five new cache tests cover eight scenarios, including repeated SET, changed values, multiple IPv4/IPv6 addresses, DEL, empty/invalid/incomplete data, preservation of unrelated interfaces, and non-exported interfaces.- Which release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request: N/A
Failure type: day-one issue
- Tested branch
- Test result
tests/test_lldp.py— 22 passed, 3 subtests passed- Description for the changelog
Fix stale and duplicate LLDP remote management address MIB cache entries after neighbor updates.