Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Backwards Indexing #5

Closed
Tracked by #6
rcgoodfellow opened this issue Aug 30, 2022 · 1 comment · Fixed by #12
Closed
Tracked by #6

Potential Backwards Indexing #5

rcgoodfellow opened this issue Aug 30, 2022 · 1 comment · Fixed by #12
Assignees

Comments

@rcgoodfellow
Copy link
Collaborator

rcgoodfellow commented Aug 30, 2022

See:

//TODO this is backwards should be?
//if(hdr.ipv6.dst[127:112] == ll) {
if(hdr.ipv6.dst[15:0] == ll) {

@rcgoodfellow rcgoodfellow mentioned this issue Aug 30, 2022
15 tasks
@rcgoodfellow rcgoodfellow self-assigned this Aug 30, 2022
@rcgoodfellow
Copy link
Collaborator Author

The crux of the issue is this statement from section 13.8 from the P4-16 specification

When extracting data into a bit-string or integer, the first packet bit is extracted to the most significant bit of the integer.

Currently, we're doing the arguably more intuitive thing of extracting the first packet bit to the first bit of a bit<N> header field.

rcgoodfellow added a commit that referenced this issue Nov 10, 2022
The p4 spec states that the first bit from a packet extracts into the
last bit of bit-string types, this means that we go from protocol-endian
to p4-endian and then back to protocol-endian on the way out.

Fixes #5.
rcgoodfellow added a commit that referenced this issue Nov 10, 2022
The p4 spec states that the first bit from a packet extracts into the
last bit of bit-string types, this means that we go from protocol-endian
to p4-endian and then back to protocol-endian on the way out.

Fixes #5.
rcgoodfellow added a commit that referenced this issue Nov 10, 2022
The p4 spec states that the first bit from a packet extracts into the
last bit of bit-string types, this means that we go from protocol-endian
to p4-endian and then back to protocol-endian on the way out.

Fixes #5.
rcgoodfellow added a commit that referenced this issue Nov 10, 2022
The p4 spec states that the first bit from a packet extracts into the
last bit of bit-string types, this means that we go from protocol-endian
to p4-endian and then back to protocol-endian on the way out.

Fixes #5.
rcgoodfellow added a commit that referenced this issue Nov 10, 2022
The p4 spec states that the first bit from a packet extracts into the
last bit of bit-string types, this means that we go from protocol-endian
to p4-endian and then back to protocol-endian on the way out.

Fixes #5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant