Skip to content

adding ethhdr type for linux/android for proper packet filtering.#4239

Merged
tgross35 merged 1 commit intorust-lang:mainfrom
devnexen:ethhdr_linux
Mar 14, 2026
Merged

adding ethhdr type for linux/android for proper packet filtering.#4239
tgross35 merged 1 commit intorust-lang:mainfrom
devnexen:ethhdr_linux

Conversation

@devnexen
Copy link
Contributor

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2025

Some changes occurred in the Android module

cc @maurer

@devnexen devnexen force-pushed the ethhdr_linux branch 5 times, most recently from 55f537d to d478bbb Compare January 12, 2025 12:55
@devnexen devnexen marked this pull request as draft January 12, 2025 13:00
@devnexen devnexen force-pushed the ethhdr_linux branch 9 times, most recently from da428da to 4f428e0 Compare January 12, 2025 16:55
Copy link

@maurer maurer left a comment

Choose a reason for hiding this comment

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

The main thing I see missing here is a use of ethhdr. A struct type with no usage by libc might not actually belong here, even though it is on the UAPI interface - this is a bindings crate for libc, not for the Linux kernel.

Is there a function in libc that you intend to call that uses the ethhdr struct? If so, layering on a commit binding that on top of this one would make a better PR IMO.


// linux/if_ether.h

#[repr(C, align(1))]
Copy link

Choose a reason for hiding this comment

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

This struct is packed and not align-1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know. was trying to solve few architectures build failures.

@devnexen
Copy link
Contributor Author

The main thing I see missing here is a use of ethhdr. A struct type with no usage by libc might not actually belong here, even though it is on the UAPI interface - this is a bindings crate for libc, not for the Linux kernel.

There is, for packet filters purpose. sendto/recvfrom can use any buffer e.g. ethhdr for this case. since AF_PACKET family and ETH_P* constants are already there, I m just trying to finish it off.

@devnexen devnexen force-pushed the ethhdr_linux branch 2 times, most recently from 930a40c to 9944b71 Compare January 24, 2025 19:55
@tgross35
Copy link
Contributor

Since this is marked as a draft:

@rustbot author

(just update the labels if that isn't accurate)

@rustbot

This comment has been minimized.

@devnexen
Copy link
Contributor Author

@rustbot ready

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks for removing it. LGTM with a squash

@rustbot

This comment has been minimized.

@tgross35
Copy link
Contributor

Sorry, guess I didn't see this was ready. Needs a rebase now

@rustbot author

@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

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

@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

Some changes occurred in an Android module

cc @maurer

@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

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.

@devnexen
Copy link
Contributor Author

@rustbot ready

@tgross35 tgross35 enabled auto-merge March 14, 2026 07:50
@tgross35 tgross35 added this pull request to the merge queue Mar 14, 2026
Merged via the queue into rust-lang:main with commit 82b7480 Mar 14, 2026
97 of 99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants