Repository navigation
Conversation
The layout marks only the big-endian typedefs, so a member typed __le16, __le32 or __le64 reads byte-swapped on a big-endian kernel. luaebpf#8 asks for the mark that reads it right, and waits in the backlog until a program on such a kernel needs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a big-endian kernel, a kernel struct's member typed
__le16,__le32or__le64reads byte-swapped, and the documentation ofbpf.vmlinux.layoutdoes not say so.The layout marks
bigendianonly the members typed__be16,__be32or__be64, so a__lemember carries no mark and reads in the kernel's byte order, which is its own only on a little-endian kernel. The documentation ofbpf.vmlinux.layoutnow says so in a paragraph of its own. Nothing a script calls changes.luaebpf#8 asks for a
littleendianmark that reads such a member right on either kernel, and waits in the backlog until a program on a big-endian kernel needs it. This one answers luaebpf#8, which it does not close.