rewrite checksum triggers in ndp/echo reply

This commit is contained in:
Nico Schottelius 2019-03-30 17:19:17 +01:00
commit cd3084d8f9
2 changed files with 8 additions and 14 deletions

View file

@ -264,17 +264,8 @@ Echo or Echo Reply Message
hdr.icmp6_option_link_layer_addr.ll_length = 1; /* 1* 64 bit */
hdr.icmp6_option_link_layer_addr.mac_addr = mac_addr;
/* version1: rebuilding packet */
/*
truncate((bit<32>)(112 + 320 + 32)/8);
hdr.icmp6_na.setValid();
hdr.icmp6_na.solicitated = 1;
hdr.icmp6_na.override = 1;
*/
/* checksum trigger / content */
meta.switch_task = TASK_CHECKSUM_ICMP6_NA;
/* 5. Checksum trigger/info */
meta.chk_icmp6_na_ns = 1;
meta.cast_length = (bit<32>) hdr.ipv6.payload_length;
}
@ -289,7 +280,8 @@ Echo or Echo Reply Message
hdr.icmp6.type = ICMP6_ECHO_REPLY;
meta.switch_task = TASK_CHECKSUM_ICMP6;
meta.chk_icmp6 = 1;
meta.cast_length = (bit<32>) hdr.ipv6.payload_length;
}
@ -373,8 +365,6 @@ Echo or Echo Reply Message
/********************** APPLYING TABLES ***********************************/
apply {
if(hdr.ipv6.isValid()) {
icmp6.apply(); /* icmp6 echo, icmp6 ndp */
if(nat64.apply().hit) { /* generic nat64 done */
if(hdr.icmp6.isValid()) {
nat64_icmp6_generic();
@ -391,6 +381,8 @@ Echo or Echo Reply Message
exit; /* no further v6 processing */
}
icmp6.apply(); /* icmp6 echo, icmp6 ndp */
v6_networks.apply(); /* regular egress / routing */
} else if(hdr.ipv4.isValid()) {
if(nat46.apply().hit) {