Skip to content

Conversation

hulthe
Copy link
Contributor

@hulthe hulthe commented Aug 6, 2025

Description

Export constants for all UDP-specific socket options on Android.
These are already exposed on Linux proper here and here.

Sources

linux/include/uapi/linux/udp.h

bionic/libc/kernel/uapi/linux/udp.h

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot
Copy link
Collaborator

rustbot commented Aug 6, 2025

Some changes occurred in the Android module

cc @maurer

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 6, 2025
@hulthe
Copy link
Contributor Author

hulthe commented Aug 6, 2025

We only need the UDP_SEGMENT and UDP_GRO for our use-case.
But thinking about it... Shouldn't I just add all the socket options in linux/include/uapi/linux/udp.h?

@maurer
Copy link

maurer commented Aug 6, 2025

The two you've added are fine. If you want to add more, please restrict yourself to those in https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/kernel/uapi/linux/udp.h - mostly that means no UDP_ENCAP_OVPNINUDP.

(This is libc, so it's bionic bindings, not Linux kernel bindings. When a constant is supported in Android it'll make its way into the bionic uapi generated headers.)

@hulthe hulthe force-pushed the android-udp-sockopt-gsogro branch from 2c9abc2 to 8a94eb1 Compare August 6, 2025 16:28
@hulthe hulthe changed the title Export UDP_SEGMENT and UDP_GRO consts on Android Export UDP socket option consts on Android Aug 6, 2025
@hulthe
Copy link
Contributor Author

hulthe commented Aug 6, 2025

@maurer Thanks for clarifying, I was not aware of the distinction with bionic.

I've updated the PR to include all UDP socket options. I've left out the ENCAP-stuff though since I am unfamiliar with them.

I've also added bionic to the list of sources.

@tgross35 tgross35 added this pull request to the merge queue Aug 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 7, 2025
@tgross35 tgross35 added this pull request to the merge queue Aug 9, 2025
Merged via the queue into rust-lang:main with commit a43bdc3 Aug 9, 2025
48 of 52 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 11, 2025
(backport <rust-lang#4619>)
(cherry picked from commit a43bdc3)
@tgross35 tgross35 mentioned this pull request Aug 11, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 11, 2025
(backport <rust-lang#4619>)
(cherry picked from commit a43bdc3)
github-merge-queue bot pushed a commit that referenced this pull request Aug 11, 2025
(backport <#4619>)
(cherry picked from commit a43bdc3)
@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 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-android O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants