Conversation
nl_sock is not thread-safe. The DispatchSource read handler, nl_send_auto, and nl_socket_use_seq were previously called from different queues concurrently. Route all nl_sock access through a single serial DispatchQueue to prevent data races.
…cations Using AsyncThrowingChannel required spawning an unstructured Task to call the async send() method from a synchronous callback, which destroyed kernel event ordering. Switch to AsyncThrowingStream with an unbounded buffering policy so yield() can be called synchronously, preserving strict event ordering.
If nl_msg_parse's callback fires zero times, obj remains nil and would crash when passed to self.init(obj:). If it fires multiple times, the previous pointer was leaked. Now release the previous object before overwriting, and throw NLError.invalidArgument if no object was parsed.
nfnl_log_alloc() can return nil on OOM. Passing nil to NLObject(consumingObj:) which expects a non-optional OpaquePointer would crash. Guard and throw NLError.noMemory instead.
…uest If message.send() throws, the stream continuation remained in the _requests dictionary forever. Remove it on error to prevent the leak.
Returning the negative errno from the error callback caused nl_recvmsgs to abort, discarding other pending messages in the receive buffer. Return NL_SKIP to continue processing remaining messages.
Pass the UnsafeRawBufferPointer directly to nlmsg_append instead of copying into an intermediate Array.
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.
No description provided.