Skip to content

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)

@devnexen devnexen force-pushed the ethhdr_linux branch 2 times, most recently from 3c77dba to 7357526 Compare February 22, 2025 21:47
@rustbot rustbot added the O-gnu label Feb 22, 2025
@devnexen devnexen marked this pull request as ready for review February 22, 2025 22:21
@tgross35 tgross35 requested a review from maurer April 25, 2025 03:50
@tgross35
Copy link
Contributor

This will need a rebase but I think it's ready for review so updating the labels

@rustbot review

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.

Sorry this fell off my radar. Just a few requests/questions

Comment on lines 2304 to 2151
// FIXME: `h_proto` is of type __be16 big endian version of __u16
(struct_ == "ethhdr" && field == "h_proto") ||
Copy link
Contributor

Choose a reason for hiding this comment

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

What doesn't it like here? As far as I can tell, the __be16 type just gets the bitwise attribute which isn't picked up by GCC https://github.com/torvalds/linux/blob/e53642b87a4f4b03a8d7e5f8507fc3cd0c595ea6/include/uapi/linux/types.h#L27-L41.

Copy link
Contributor

Choose a reason for hiding this comment

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

@devnexen what are the errors with this one?

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 forgot since, gonna try removing it

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 recall just now it was for some archs only.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you paste the actual error here? I still don't understand how this could be failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It happened only on CI but seems it does not happen anymore.

@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2025

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

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

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