Skip to content

bsd: add IN6_IFF_* and SIOCGIFAFLAG_IN6 on apple and freebsd#5239

Open
sbogomolov wants to merge 3 commits into
rust-lang:mainfrom
sbogomolov:bsd-in6-ifflags
Open

bsd: add IN6_IFF_* and SIOCGIFAFLAG_IN6 on apple and freebsd#5239
sbogomolov wants to merge 3 commits into
rust-lang:mainfrom
sbogomolov:bsd-in6-ifflags

Conversation

@sbogomolov

@sbogomolov sbogomolov commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

Add the IN6_IFF_* address flags and the SIOCGIFAFLAG_IN6 ioctl from
netinet6/in6_var.h on Apple and FreeBSD. The flag sets differ a bit: Apple
defines DYNAMIC, OPTIMISTIC, SECURED, CLAT46, and NOPFX that FreeBSD
doesn't, and FreeBSD has PREFER_SOURCE.

SIOCGIFAFLAG_IN6 is derived with _IOWR instead of hardcoding the value,
which needs the _IO* helpers on FreeBSD and in6_ifreq (plus the structs
its union embeds) on both — Apple already had the struct.

Sources

Apple IN6_IFF_* / SIOCGIFAFLAG_IN6 (netinet6/in6_var.h):

FreeBSD IN6_IFF_* / SIOCGIFAFLAG_IN6 (netinet6/in6_var.h):

FreeBSD in6_ifreq / in6_addrlifetime / in6_ifstat / icmp6_ifstat (netinet6/in6_var.h):

FreeBSD _IO* (sys/ioccom.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 label +stable-nominated

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

This comment has been minimized.

@rustbot

This comment has been minimized.

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request to add and use the I/O macros, otherwise LGTM. Thank you for including permalinks and for adding these in new/!

View changes since this review

Comment thread src/new/apple/xnu/netinet6/in6_var.rs Outdated
Comment thread src/new/freebsd/netinet6/in6_var.rs Outdated
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@sbogomolov sbogomolov force-pushed the bsd-in6-ifflags branch 2 times, most recently from 44c02c2 to f7ecc55 Compare July 9, 2026 16:43
@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

sbogomolov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Request to add and use the I/O macros, otherwise LGTM.

@tgross35 Done.

@rustbot ready

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