Skip to content

rtnetlink: fix Link ListByKind response#233

Merged
jsimonetti merged 1 commit intojsimonetti:masterfrom
boussole:link_list_by_kind_fix
Dec 17, 2024
Merged

rtnetlink: fix Link ListByKind response#233
jsimonetti merged 1 commit intojsimonetti:masterfrom
boussole:link_list_by_kind_fix

Conversation

@boussole
Copy link
Copy Markdown
Contributor

the linux kernel handles a RTM_GETLINK request even in case of incorrent kind filter. if it finds requested kind it responds with a list of this kind of links and marks every message in a response by NLM_F_DUMP_FILTERED flag. Otherwise it sends all available links w/o NLF_F_DUMP_FILTERED. So, looks much better to return to a callee empty link list if there are no links of requested kind.

@boussole boussole force-pushed the link_list_by_kind_fix branch from 25821ed to 585c357 Compare August 8, 2024 00:49
@boussole boussole force-pushed the link_list_by_kind_fix branch 2 times, most recently from b4d1e0e to 466055d Compare December 17, 2024 17:56
@jsimonetti
Copy link
Copy Markdown
Owner

Thank you for this contribution.
Is there an easy way we can build a test for this case?

@boussole boussole force-pushed the link_list_by_kind_fix branch from 466055d to 38378ed Compare December 17, 2024 18:42
@boussole
Copy link
Copy Markdown
Contributor Author

Yes, I added a simple test that shows a previous problem

the linux kernel handles a RTM_GETLINK request even in case of incorrect
kind filter. if it finds requested kind it responds with
a list of this kind of links and marks every message in a response
by NLM_F_DUMP_FILTERED flag. Otherwise it sends all available links
w/o NLF_F_DUMP_FILTERED. So, looks much better to return to a callee
empty link list if there are no links of requested kind.

Signed-off-by: Andrey Grafin <[email protected]>
@boussole boussole force-pushed the link_list_by_kind_fix branch from 38378ed to c5984d2 Compare December 17, 2024 19:26
@jsimonetti
Copy link
Copy Markdown
Owner

Thank you!

@jsimonetti jsimonetti merged commit d045a24 into jsimonetti:master Dec 17, 2024
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.

2 participants