Skip to content

Commit

Permalink
check that ipv6 header is valid before using
Browse files Browse the repository at this point in the history
This currently causes a crash in x4c compiled code. A good question is
what should happen here. According to P4 spec x4c should emit an
unspecified value. According to ry we should apport the pipeline.

- #6

Perhaps we can catch some of these at compile time?

- #7
  • Loading branch information
rcgoodfellow committed Sep 2, 2022
1 parent 86a6a94 commit c02cf0b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/src/p4/sidecar-lite.p4
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,13 @@ control local(

apply {
local.apply();

bit<16> ll = 16w0xff02;

//TODO this is backwards should be
//if(hdr.ipv6.dst[127:112] == ll) {
if(hdr.ipv6.dst[15:0] == ll) {
is_local = true;
if(hdr.ipv6.isValid()) {
bit<16> ll = 16w0xff02;
//TODO this is backwards should be
//if(hdr.ipv6.dst[127:112] == ll) {
if(hdr.ipv6.dst[15:0] == ll) {
is_local = true;
}
}
}

Expand Down

0 comments on commit c02cf0b

Please sign in to comment.