Skip to content

Conversation

@sumansaurabh
Copy link

Summary

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

Changes

  • Added SEQPACKET socket type handling in vsock implementation
  • Enhanced socket type validation to ensure host UDS matches vsock socket type
  • Updated connection logic to support both SOCK_STREAM and SOCK_SEQPACKET
  • Added proper error handling for socket type mismatches

Motivation

This change addresses the need for VMs to relay datagrams over vsock while maintaining packet boundaries, which SOCK_STREAM cannot provide as it combines packets together. The VIRTIO_VSOCK_F_SEQPACKET feature is part of the virtio specification v1.2.

Testing

  • Verified SEQPACKET socket creation and connection
  • Tested socket type validation between vsock and host UDS
  • Ensured backward compatibility with existing SOCK_STREAM functionality

Fixes #4822


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

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