Merged
Conversation
Collaborator
|
This is looking really good, thanks @mtjhrc. Could you please rebase on top of current main? |
The TSI datagram implementation had a bug where err == 0 was used to check sendmsg success, but sendmsg returns the number of bytes sent (positive value) on success. This caused the socket to never properly transition to S_VSOCK state, though datagrams still worked because S_HYBRID always fell through to the vsock path. Changes setsockopt fixes: - Add a defensive null pointer check before calling isocket->ops->setsockopt to prevent kernel panic when the underlying socket doesn't implement setsockopt - Add SOL_SOCKET level handling in tsi_dgram_setsockopt (was missing, unlike the stream version) sendmsg fixes: - Fix state transition condition from err == 0 to err > 0 - sendmsg returns bytes sent (positive) on success, never zero - Add local UDP listener detection via tsi_has_udp_listener() before proxying to host, enabling proper guest-to-guest localhost UDP communication recvmsg fixes: - Make S_HYBRID state actually try receiving from inet socket instead of returning -ENOTCONN - Restore msg_namelen after receiving proxied datagrams via vsock (fixes IPv6 UDP) Signed-off-by: Matej Hrica <mhrica@redhat.com>
Do an apt-get update before installing packages to ensure the archives are fresh. Signed-off-by: Sergio Lopez <slp@redhat.com>
Collaborator
|
SEV and TDX builds fail with: That's because TSI now depends in INET6. Please update |
Signed-off-by: Matej Hrica <mhrica@redhat.com>
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 TSI datagram implementation had a bug where err == 0 was used to check sendmsg success, but sendmsg returns the number of bytes sent (positive value) on success. This caused the socket to never properly transition to S_VSOCK state, though datagrams still worked because S_HYBRID always fell through to the vsock path.
Changes
setsockopt fixes:
sendmsg fixes:
recvmsg fixes:
This fixes the newly added tests in containers/libkrun#472