Skip to content

apple: add ifaliasreq and in6_aliasreq - #5557

Open
xjtu-ctgg wants to merge 1 commit into
rust-lang:mainfrom
xjtu-ctgg:apple-ifaliasreq
Open

xjtu-ctgg wants to merge 1 commit into
rust-lang:mainfrom
xjtu-ctgg:apple-ifaliasreq

Conversation

@xjtu-ctgg

@xjtu-ctgg xjtu-ctgg commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add ifaliasreq from net/if.h and in6_aliasreq from netinet6/in6_var.h.

SIOCAIFADDR and SIOCSIFPHYADDR now take their size from ifaliasreq instead of a hardcoded 64, so their values stay the same. SIOCAIFADDR_IN6 and SIOCSIFPHYADDR_IN6 are added now that in6_aliasreq exists, along with SIOCDIFADDR_IN6 to go with them.

ifaliasreq follows the sockaddr layout from the non-__has_ptrcheck side of the header. in6_aliasreq is macOS only, like the in6_addrlifetime it contains.

Closes #4435

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard doc comment (none added)
  • Tested locally (cargo test -p libc-test --target aarch64-apple-darwin, plus cargo check for aarch64-apple-ios and x86_64-apple-darwin)

@rustbot label +stable-nominated

Copilot AI lite review requested due to automatic review settings September 24, 2026 08:23
@rustbot rustbot added O-bsd O-macos O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@xjtu-ctgg

Copy link
Copy Markdown
Contributor Author

The Android job hit its 25 minute timeout before the tests finished. It normally takes 8–9 minutes and passed on #5558 and #5559, so this looks like the emulator stalling. NetBSD failed on the package mirror, with the retry broken by sleep 3s (fixed in #5559), and Solaris was cancelled along with it. All three should pass on a re-run.

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

One request then LGTM

View changes since this review

Comment thread src/new/apple/xnu/netinet6/in6_var.rs Outdated
use crate::prelude::*;
use crate::sys::ioccom::*;

s! {

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.

Use s2! rather than s! for new API, it adds a Default impl and makes it effectively non-exhaustive.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, switched both new structs (in6_aliasreq and ifaliasreq) to s2!. Their fields are s! types without Default, so I used #[custom_default(unsafe { mem::zeroed::<...>() })] as in sockaddr_can.

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.

I'm adding the default impls in #5576 so the unsafe doesn't need to be used. Could you rebase once that lands?

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.

That PR has landed,
@rustbot author

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rebased, and the custom_defaults are gone now that the field types have Default. I also moved ifaliasreq into the existing s2! block.

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

@rustbot

rustbot commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

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

@xjtu-ctgg

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot

This comment has been minimized.

@xjtu-ctgg

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot

rustbot commented Oct 7, 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.

This branch has not been deployed

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

Labels

O-bsd O-macos O-unix 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.

darwin: add in6_aliasreq, ifaliasreq structs

4 participants