Fix total_length by adding 15 bytes

This commit is contained in:
Nico Schottelius 2019-03-30 18:11:04 +01:00
commit 801b4d818e
2 changed files with 69 additions and 3 deletions

View file

@ -77,8 +77,8 @@ control MyIngress(inout headers hdr,
/* 5 is ok as long as we don't use options / padding /
anything after the destination address */
hdr.ipv4.ihl = (bit<4>) 5; // internet header length - static for us
hdr.ipv4.totalLen = (bit<16>) hdr.ipv6.payload_length + 5; // ok under above constraints
hdr.ipv4.ihl = (bit<4>) 5; // internet header length: 4*5 = 20
hdr.ipv4.totalLen = (bit<16>) hdr.ipv6.payload_length + 20; // ok under above constraints
hdr.ipv4.identification = (bit<16>) 0; // no support for fragments
hdr.ipv4.flags = (bit<3>) 0; // DF bit and more fragments, unsupported ATM