[p4] icmp6 hard code length
This commit is contained in:
parent
1f497982b3
commit
b3e51d550a
1 changed files with 3 additions and 2 deletions
|
@ -21,14 +21,15 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
|||
|
||||
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply {
|
||||
bit<32> cksum = (bit<32>) hdr.ipv6.payload_length;
|
||||
|
||||
bit<32> icmp6_len = 1; /* for icmp6 NS */
|
||||
|
||||
update_checksum (
|
||||
hdr.icmp6.isValid(),
|
||||
{
|
||||
hdr.ipv6.src_addr, /* 128 */
|
||||
hdr.ipv6.dst_addr, /* 128 */
|
||||
cksum, /* 32 */
|
||||
icmp6_len, /* 32 */
|
||||
24w0, /* 24 0's */
|
||||
PROTO_ICMP6 /* 8 */
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue