Skip to content

Conversation

@sumansaurabh
Copy link

Summary

Implements SEQPACKET socket type support for virtio vsock to enable datagram relay use cases while preserving message boundaries.

Changes Made

  • Added VIRTIO_VSOCK_F_SEQPACKET feature flag support
  • Implemented SOCK_SEQPACKET socket type handling in vsock implementation
  • Added socket type validation to ensure host UDS matches vsock socket type
  • Enhanced connection logic to handle SEQPACKET connections appropriately

Why This Change

This addresses GitHub Issue #4822 by enabling VMs to relay datagrams over vsock while maintaining packet boundaries, which is not possible with SOCK_STREAM that combines messages together. This provides a more efficient solution than implementing custom packet boundaries within stream sockets.

Testing

Verified that:

  • SOCK_SEQPACKET connections can be established successfully
  • Socket type mismatches are properly rejected
  • Message boundaries are preserved in SEQPACKET mode

Fixes #4822


This PR was created from task: https://cloud.blackbox.ai/tasks/Nuype64zWauLUuobO0u01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add SEQPACKET socket type for vsock

2 participants