Repository navigation
Conversation
The rtnl module caches an internal netlink socket across uc_nl_request() calls. However, if a request fails or is interrupted (for example, during a multi-part link/address dump query that triggers -EBUSY or sequence number mismatch), unread packets can remain in the socket's receive buffer and kernel dump state remains attached to the socket. Because the socket was never closed or reset upon error, subsequent requests on the same socket read leftover responses from the previous transaction, leading to persistent NLE_SEQ_MISMATCH failures. Fix this by: 1. Closing and resetting the cached socket whenever connect, setsockopt, send, or receive fails (including STATE_ERROR and interrupted reply states), avoiding caching a broken or half-open socket. 2. Exporting an explicit rtnl.close() function to allow callers to close and reset the cached request socket at will. Fixes: ucode-lang#422 Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
This branch has not been deployed
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.
The rtnl module caches an internal netlink socket across uc_nl_request() calls. However, if a request fails or is interrupted (for example, during a multi-part link/address dump query that triggers -EBUSY or sequence number mismatch), unread packets can remain in the socket's receive buffer and kernel dump state remains attached to the socket.
Because the socket was never closed or reset upon error, subsequent requests on the same socket read leftover responses from the previous transaction, leading to persistent NLE_SEQ_MISMATCH failures.
Fix this by:
Fixes: #422