Browse Source

Mixed up condition for output port...

master
Nico Schottelius 3 years ago
parent
commit
94c98e6d20
  1. 14
      p4src/actions_nat64_generic.p4
  2. 8
      p4src/netpfga_nat64.p4

14
p4src/actions_nat64_generic.p4

@ -146,15 +146,15 @@ action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) {
}
/* matching key: v4_network specified again */
action nat46_static(ipv6_addr_t v6_src, ipv4_addr_t v4_dst, ipv6_addr_t nat64_prefix) {
ipv6_addr_t src = nat64_prefix + (ipv6_addr_t) hdr.ipv4.src_addr;
/* matching key: v4_network specified again */
action nat46_static(ipv6_addr_t v6_src, ipv4_addr_t v4_dst, ipv6_addr_t nat64_prefix) {
ipv6_addr_t src = nat64_prefix + (ipv6_addr_t) hdr.ipv4.src_addr;
ipv4_addr_t dst_offset = hdr.ipv4.dst_addr - v4_dst;
ipv6_addr_t dst = v6_src + (ipv6_addr_t) dst_offset;
ipv4_addr_t dst_offset = hdr.ipv4.dst_addr - v4_dst;
ipv6_addr_t dst = v6_src + (ipv6_addr_t) dst_offset;
nat46_generic(src, dst);
}
nat46_generic(src, dst);
}
table nat64 {
key = {

8
p4src/netpfga_nat64.p4

@ -25,8 +25,8 @@ if(hdr.ipv6.isValid()) {
if(hdr.tcp.isValid()) {
delta_tcp_from_v6_to_v4
}
apply_v4networks = false;
apply_v6networks = true;
apply_v4networks = true;
apply_v6networks = false;
}
} else if(hdr.ipv4.isValid()) {
apply_v4networks = true;
@ -48,8 +48,8 @@ if(hdr.ipv6.isValid()) {
if(hdr.tcp.isValid()) {
delta_tcp_from_v4_to_v6
}
apply_v4networks = true;
apply_v6networks = false;
apply_v4networks = false;
apply_v6networks = true;
}
}

Loading…
Cancel
Save