firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

feat: Add SEQPACKET socket type support for vsock

Open sumansaurabh opened this issue 3 months ago • 0 comments

Summary

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

Changes

  • 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
  • Updated connection logic to handle SEQPACKET connections appropriately

Why

This addresses the limitation where VMs relaying datagrams over vsock need to preserve packet boundaries, which SOCK_STREAM combines together. The SEQPACKET type maintains message boundaries while providing reliable, ordered delivery.

Testing

  • Verified SOCK_SEQPACKET socket creation and connection establishment
  • Confirmed socket type mismatch rejection between guest and host
  • Validated packet boundary preservation in data transmission

Fixes #4822


This PR was created from task: https://remote-code-1.onrender.com/tasks/hATFTs3x7VF1zV1Wokznz

sumansaurabh avatar Nov 08 '25 14:11 sumansaurabh