Merged
Conversation
When listener.request() sends a request on the shared event socket, the receive loop uses a callback set that only knows about request-reply processing. Multicast events arriving during this window are either misprocessed as replies, or cause recvmsgs() to abort with a sequence number mismatch (multicast events carry seq 0), losing any remaining messages in the same receive buffer. Fix this by disabling the default sequence check when operating on the event socket and forwarding multicast events (identified by nlmsg_seq == 0) from cb_reply to cb_listener_event. Signed-off-by: Felix Fietkau <nbd@nbd.name>
The poll() call was outside the receive loop, so it only waited for the first batch of data. If that batch didn't contain the desired command, the while loop called nl_recvmsgs() repeatedly on the non-blocking socket, spinning on EAGAIN returns without ever blocking for new data. Move poll() inside the loop so it blocks between receive batches. Track elapsed time with CLOCK_MONOTONIC to honor the original timeout across iterations. Signed-off-by: Felix Fietkau <nbd@nbd.name>
When multiple messages matching the command filter arrive in a single receive buffer, cb_event() overwrites s->res without freeing the previous value. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Only set s->cmd (which terminates the waitfor loop) when uc_nl_prepare_event() succeeds. Previously a parse failure still set s->cmd, causing waitfor() to return a match with a null message body. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Owner
|
Merged, thanks! |
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.
A small set of fixes for the nl80211 module