Skip to content

bsd: round out BPF bindings on apple and freebsd#5235

Open
sbogomolov wants to merge 2 commits into
rust-lang:mainfrom
sbogomolov:bsd-bpf-bindings
Open

bsd: round out BPF bindings on apple and freebsd#5235
sbogomolov wants to merge 2 commits into
rust-lang:mainfrom
sbogomolov:bsd-bpf-bindings

Conversation

@sbogomolov

@sbogomolov sbogomolov commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

Make the BPF bindings match across Apple and FreeBSD: add bpf_program and bpf_insn on Apple (FreeBSD already has them), and the DLT_* link-layer types on FreeBSD/DragonFly (Apple already has them).

Sources

Apple bpf_program / bpf_insn (net/bpf.h):

FreeBSD DLT_* (net/dlt.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 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
@sbogomolov

Copy link
Copy Markdown
Contributor Author

Could someone please re-run the aarch64-linux-android job?

@tgross35

Copy link
Copy Markdown
Contributor

The PR template asks for links to source headers. Could you please include them?

@sbogomolov sbogomolov marked this pull request as draft July 1, 2026 08:59
@sbogomolov sbogomolov force-pushed the bsd-bpf-bindings branch 4 times, most recently from fd2ea25 to 646c595 Compare July 1, 2026 10:31
apple was missing the two bpf structs; freebsd was missing the DLT_*
link types.
@sbogomolov sbogomolov marked this pull request as ready for review July 1, 2026 10:33
@sbogomolov

Copy link
Copy Markdown
Contributor Author

@tgross35 I've addressed your comment and also moved everything under src/new.

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