Skip to content

Commit b985444

Browse files
hikejsclaude
andcommitted
fix(vsock): remove unimplemented DGRAM feature advertisement
Remove VIRTIO_VSOCK_F_DGRAM from advertised features since DGRAM support is not yet implemented. The current code rejects DGRAM packets with RST (line 647-650), so advertising the feature would mislead guests into thinking DGRAM is supported. Also suppress dead_code warnings for TSO constants that are reserved for future implementation. This prevents guests from attempting to use DGRAM sockets and receiving unexpected RST responses. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ca44c69 commit b985444

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/devices/src/virtio/net_windows.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ const VIRTIO_NET_HDR_F_DATA_VALID: u8 = 2;
5555

5656
// virtio-net GSO types
5757
const VIRTIO_NET_HDR_GSO_NONE: u8 = 0;
58+
#[allow(dead_code)] // Reserved for future TSO implementation
5859
const VIRTIO_NET_HDR_GSO_TCPV4: u8 = 1;
60+
#[allow(dead_code)] // Reserved for future TSO implementation
5961
const VIRTIO_NET_HDR_GSO_TCPV6: u8 = 4;
6062

6163
// ── virtio-net header ─────────────────────────────────────────────────────────

src/devices/src/virtio/vsock_windows.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ const MAX_RW_PAYLOAD: usize = 64 * 1024;
5555
const MAX_READ_BURST_PER_STREAM: usize = 8;
5656

5757
const AVAIL_FEATURES: u64 = (1 << VIRTIO_F_VERSION_1 as u64)
58-
| (1 << VIRTIO_F_IN_ORDER as u64)
59-
| (1 << VIRTIO_VSOCK_F_DGRAM as u64);
58+
| (1 << VIRTIO_F_IN_ORDER as u64);
59+
// Note: VIRTIO_VSOCK_F_DGRAM is not yet implemented
60+
// | (1 << VIRTIO_VSOCK_F_DGRAM as u64);
6061

6162
bitflags! {
6263
pub struct TsiFlags: u32 {

0 commit comments

Comments
 (0)