aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_det_in2out.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-10-10 09:46:06 +0000
committerOle Trøan <otroan@employees.org>2020-01-03 10:10:15 +0000
commitf126e746fc01c75bc99329d10ce9127b26b23814 (patch)
treefaf9f09a363add6e140f30e25187b330843b3d21 /src/plugins/nat/nat_det_in2out.c
parent3535501b19aec95dfd32870c784f841f57b5c045 (diff)
nat: use SVR
Remove NAT's implementation of shallow virtual reassembly with corresponding CLIs, APIs & tests. Replace with standalone shallow virtual reassembly provided by ipX-sv-reass* nodes. Type: refactor Change-Id: I7e6c7487a5a500d591f6871474a359e0993e59b6 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat_det_in2out.c')
-rw-r--r--src/plugins/nat/nat_det_in2out.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/nat/nat_det_in2out.c b/src/plugins/nat/nat_det_in2out.c
index 832a2bae947..384a1eb54b9 100644
--- a/src/plugins/nat/nat_det_in2out.c
+++ b/src/plugins/nat/nat_det_in2out.c
@@ -121,14 +121,16 @@ icmp_match_in2out_det (snat_main_t * sm, vlib_node_runtime_t * node,
sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
rx_fib_index0 = ip4_fib_table_get_index_for_sw_if_index (sw_if_index0);
- if (!icmp_is_error_message (icmp0))
+ if (!icmp_type_is_error_message
+ (vnet_buffer (b0)->ip.reass.icmp_type_or_tcp_flags))
{
protocol = SNAT_PROTOCOL_ICMP;
in_addr = ip0->src_address;
- in_port = echo0->identifier;
+ in_port = vnet_buffer (b0)->ip.reass.l4_src_port;
}
else
{
+ /* if error message, then it's not fragmented and we can access it */
inner_ip0 = (ip4_header_t *) (echo0 + 1);
l4_header = ip4_next_header (inner_ip0);
protocol = ip_proto_to_snat_proto (inner_ip0->protocol);
@@ -213,8 +215,10 @@ icmp_match_in2out_det (snat_main_t * sm, vlib_node_runtime_t * node,
}
}
- if (PREDICT_FALSE (icmp0->type != ICMP4_echo_request &&
- !icmp_is_error_message (icmp0)))
+ if (PREDICT_FALSE
+ (vnet_buffer (b0)->ip.reass.icmp_type_or_tcp_flags != ICMP4_echo_request
+ && !icmp_type_is_error_message (vnet_buffer (b0)->ip.
+ reass.icmp_type_or_tcp_flags)))
{
b0->error = node->errors[NAT_DET_IN2OUT_ERROR_BAD_ICMP_TYPE];
next0 = NAT_DET_IN2OUT_NEXT_DROP;