Skip to content

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

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
sbogomolov:rfc3678-multicast
Aug 4, 2026
Merged

Add RFC 3678 multicast group_req/group_source_req and MCAST_*#5236
tgross35 merged 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
Member

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

@sbogomolov
sbogomolov force-pushed the rfc3678-multicast branch from e2fc905 to 5383022 Compare July 9, 2026 16:03
@rustbot

This comment has been minimized.

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

@rustbot

This comment has been minimized.

@maurer

maurer commented Jul 20, 2026

Copy link
Copy Markdown

Change fine for Android, just regular libc stuff to look at.

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 Aug 2, 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.

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgross35
tgross35 added this pull request to the merge queue Aug 4, 2026
Merged via the queue into rust-lang:main with commit 605ebff Aug 4, 2026
57 checks passed
@sbogomolov
sbogomolov deleted the rfc3678-multicast branch August 4, 2026 07:20
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 31, 2026
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.

(backport <rust-lang#5236>)
(cherry picked from commit 605ebff)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 31, 2026
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.

(backport <rust-lang#5236>)
(cherry picked from commit 605ebff)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 31, 2026
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.

(backport <rust-lang#5236>)
(cherry picked from commit 605ebff)
@tgross35 tgross35 mentioned this pull request Aug 31, 2026
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Aug 31, 2026
tgross35 pushed a commit to dybucc/libc that referenced this pull request Aug 31, 2026
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.

(backport <rust-lang#5236>)
(cherry picked from commit 605ebff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants