Don't just wait for a response because NLM_F_REQUEST is set - #44
Open
Toorero wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
The current behaviour could lead to a bunch of stale |
Contributor
Author
|
This would also allow to work around Kernels not acknowledging On kernels prior to bf2ac49 (e.g. Ubuntu 24.04 LTS) the newly introduced method In general, it is not recommended [1] to force the kernel to acknowledge every message. If you batch messages, requesting and receiving a single acknowledgement should be enough, since it's an all-or-nothing-operation. |
Toorero
force-pushed
the
fix/expect_response_on_req
branch
from
August 14, 2026 13:32
dcd1deb to
b1f09a0
Compare
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.
It is incorrect assuming a response is guaranteed solely because
NLM_F_REQUESTis set.NLM_F_REQUESTby itself only marks a message as coming from user space and is a requirement to make successful requests to the kernel as an application.1We can only assume a response (in form of an ACK or error) is guaranteed if
NLM_F_ACKis set.2Then either an error or an ack is getting returned.
Further research is needed to determine if a response is guaranteed on
NLM_F_ECHOas the kernel doc states it isn't universally implemented3. In my mind sending aNLM_F_REQUEST | NLM_F_ECHOrequest could produce no response if the message is successful (no ACK is issued, becauseNLM_F_ACKis unset) but the addressed system doesn't implement echo or the request changes nothing.Footnotes
https://github.com/torvalds/linux/blob/f5bbbfec59b4e2fb7520a91de3df8a6174325d6a/net/netlink/af_netlink.c#L2548-L2550 ↩
https://github.com/torvalds/linux/blob/f5bbbfec59b4e2fb7520a91de3df8a6174325d6a/net/netlink/af_netlink.c#L2560-L2562 ↩
https://github.com/torvalds/linux/blob/f5bbbfec59b4e2fb7520a91de3df8a6174325d6a/Documentation/userspace-api/netlink/intro.rst#notification-echo ↩