Skip to content

Add RFC 3678 multicast group_req/group_source_req and MCAST_*#5236

Open
sbogomolov wants to merge 1 commit into
rust-lang:mainfrom
sbogomolov:rfc3678-multicast
Open

Add RFC 3678 multicast group_req/group_source_req and MCAST_*#5236
sbogomolov wants to merge 1 commit into
rust-lang:mainfrom
sbogomolov:rfc3678-multicast

Conversation

@sbogomolov

@sbogomolov sbogomolov commented Jun 30, 2026

Copy link
Copy Markdown

Description

Add group_req/group_source_req and the MCAST_* socket options for the protocol-independent multicast API (RFC 3678) on Linux, Apple, and FreeBSD. Linux already had the MCAST_* constants. Apple needs #[repr(packed(4))] since the structs are under #pragma pack(4) there. DragonFly doesn't have this API, so it's FreeBSD-only.

Sources

Linux group_req / group_source_req (linux/in.h):

Apple group_req / group_source_req / MCAST_* (netinet/in.h):

FreeBSD group_req / group_source_req / MCAST_* (netinet/in.h):

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are included
  • Tested locally (cd libc-test && cargo test --target mytarget)

Add the protocol-independent multicast group membership request structs
`group_req` and `group_source_req` (RFC 3678) on Linux, Apple, and
FreeBSD, and the `MCAST_*` socket-option constants on Apple and FreeBSD
(Linux already defines them).

Apple wraps the structs in `#pragma pack(4)`, so they are
`#[repr(packed(4))]` there; Linux and FreeBSD use natural alignment.
DragonFly lacks the RFC 3678 multicast API, so it is excluded.
@rustbot

rustbot commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in an Android module

cc @maurer

@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jun 30, 2026
@tgross35

Copy link
Copy Markdown
Contributor

@sbogomolov do you actually have a use these constants? Three PRs in the past few hours is a lot.

Also, these PR descriptions look like they may be AI-generated. Please handwrite all PR descriptions and commit messages, and make sure to include the information requested in the PR template.

@sbogomolov

Copy link
Copy Markdown
Author

@sbogomolov do you actually have a use these constants? Three PRs in the past few hours is a lot.

Also, these PR descriptions look like they may be AI-generated. Please handwrite all PR descriptions and commit messages, and make sure to include the information requested in the PR template.

I actually use these, yes :) Not every single constant is used by me, but I thought it would make sense to add related constants together. They are used in my reflector project (mDNS, SSDP/DIAL, WoL). I'm trying to create PRs for all constants / structs that I had to manually define.

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

Labels

S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants