Skip to content

Conversation

@jafingerhut
Copy link
Contributor

The bug manifests itself if bit_offset becomes 8 or larger, which happens in some cases if there are multiple fields in the packet-in header that are not a multiple of 8 bits wide.

The bug manifests itself if bit_offset becomes 8 or larger, which
happens in some cases if there are multiple fields in the packet-in
header that are not a multiple of 8 bits wide.

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Copy link
Member

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM, even though I'd suggest adding a corresponding test case in https://github.com/p4lang/PI/blob/main/proto/tests/test_proto_fe_packet_io.cpp

…h it

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
@jafingerhut
Copy link
Contributor Author

LGTM, even though I'd suggest adding a corresponding test case in https://github.com/p4lang/PI/blob/main/proto/tests/test_proto_fe_packet_io.cpp

I made a small change to one of the existing unit tests, and verified that without the proposed fix the test fails, but with the proposed fix the test passes.

@jafingerhut
Copy link
Contributor Author

Merging this, after modifying an existing test case so that it would have caught the bug.

@jafingerhut jafingerhut merged commit d28b31e into p4lang:main May 18, 2025
5 checks passed
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 this pull request may close these issues.

2 participants