Skip to content

Fix multicast socket option mapping - #388

Open
UnitZeroOne wants to merge 1 commit into
FrodeSolheim:mainfrom
UnitZeroOne:fix/bsdsocket-multicast-options
Open

UnitZeroOne wants to merge 1 commit into
FrodeSolheim:mainfrom
UnitZeroOne:fix/bsdsocket-multicast-options

Conversation

@UnitZeroOne

Copy link
Copy Markdown

Problem

The POSIX socket bridge treats several IPv4 multicast options as four-byte integers. TTL and loopback are one-byte values, while interface and membership options contain network-order addresses.

This can overwrite the TTL/loopback buffers, reverse address bytes on little-endian hosts, and leave part of a membership request uninitialized.

Fix

Handle TTL and loopback as single bytes, copy the address structures without changing byte order, and reject invalid lengths with EINVAL.

This is intentionally a small, focused fix. Related getsockopt() handling, allocation checks, and broader guest-memory validation are left for separate changes.

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.

1 participant