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
Contributor

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)

@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
Contributor 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.

@sbogomolov sbogomolov marked this pull request as draft July 1, 2026 08:59
@sbogomolov sbogomolov force-pushed the rfc3678-multicast branch from 6bf280f to c08df52 Compare July 1, 2026 10:43
@sbogomolov sbogomolov marked this pull request as ready for review July 1, 2026 11:26
@sbogomolov sbogomolov force-pushed the rfc3678-multicast branch from c08df52 to 4a5c221 Compare July 2, 2026 11:55
@rustbot

This comment has been minimized.

@sbogomolov sbogomolov force-pushed the rfc3678-multicast branch from 4a5c221 to e2fc905 Compare July 7, 2026 13:15
@rustbot

This comment has been minimized.

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.
@sbogomolov sbogomolov force-pushed the rfc3678-multicast branch from e2fc905 to 5383022 Compare July 9, 2026 16:03
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@sbogomolov

Copy link
Copy Markdown
Contributor Author

@tgross35 for this one I did not move anything to src/new. Let me know if you want something rearranged.

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