++stuff
This commit is contained in:
parent
09d5c23aad
commit
378e16f48c
3 changed files with 29 additions and 11 deletions
|
@ -4986,6 +4986,8 @@ Using
|
|||
|
||||
#+END_CENTER
|
||||
|
||||
--> gateway not reachable! -> need to verify neighbor discovery
|
||||
|
||||
** References / Follow up
|
||||
*** RFC 791 IPv4 https://tools.ietf.org/html/rfc791
|
||||
*** RFC 792 ICMP https://tools.ietf.org/html/rfc792
|
||||
|
|
|
@ -37,4 +37,29 @@ action v6sum() {
|
|||
meta.v6sum = meta.v6sum + (bit<16>) hdr.ipv6.next_header; // 8 bit
|
||||
}
|
||||
|
||||
action delta_udp_from_v4_to_v6()
|
||||
{
|
||||
v4sum();
|
||||
v6sum();
|
||||
bit<16> diff = meta.v6sum - meta.v4sum;
|
||||
hdr.udp.checksum = hdr.udp.checksum + ~diff +1;
|
||||
}
|
||||
|
||||
action delta_tcp_from_v4_to_v6()
|
||||
{
|
||||
v4sum();
|
||||
v6sum();
|
||||
bit<16> diff = meta.v6sum - meta.v4sum;
|
||||
hdr.tcp.checksum = hdr.tcp.checksum + ~diff +1;
|
||||
}
|
||||
|
||||
action delta_ipv4_from_v6_to_v4()
|
||||
{
|
||||
v4sum();
|
||||
v6sum();
|
||||
bit<16> diff = meta.v6sum - meta.v4sum;
|
||||
hdr.tcp.checksum = hdr.tcp.checksum + ~diff +1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -85,23 +85,14 @@ control MyIngress(inout headers hdr,
|
|||
}
|
||||
if(hdr.udp.isValid()) {
|
||||
#ifdef USE_NICO_DELTA_CHECKSUM
|
||||
v4sum();
|
||||
v6sum();
|
||||
bit<16> diff = meta.v6sum - meta.v4sum;
|
||||
hdr.udp.checksum = hdr.udp.checksum + ~diff +1;
|
||||
// hdr.udp.checksum = ~diff;
|
||||
|
||||
delta_udp_from_v4_to_v6();
|
||||
#else
|
||||
meta.chk_udp_v6 = 1;
|
||||
#endif
|
||||
}
|
||||
if(hdr.tcp.isValid()) {
|
||||
#ifdef USE_NICO_DELTA_CHECKSUM
|
||||
v4sum();
|
||||
v6sum();
|
||||
bit<16> diff = meta.v6sum - meta.v4sum;
|
||||
hdr.tcp.checksum = hdr.tcp.checksum + ~diff +1;
|
||||
|
||||
delta_tcp_from_v4_to_v6();
|
||||
#else
|
||||
|
||||
meta.chk_tcp_v6 = 1;
|
||||
|
|
Loading…
Reference in a new issue