ip: add extended shallow reassembly

This patch adds some fixes and improvements:

Fixes bug where save_rewrite_length gets overwritten on reassembly
handoff.

Fixes bug where duplicate fragments could cause a reassembly context
to be lost, because the race losing thread would remove bihash entry
created by winning thread.

Improves tracing by adding more events.

Adds extended shallow reassembly. This is a toggleable option, which if
turned on will cause reassembly to wait for both first and last
fragments to calculate total IP payload length. Furthermore it'll store
a local copy of first fragment and necessary data to retrieve it in
vnet_buffer2. This allows downstream features to access full L3/L4
headers when dealing with fragments.

Type: fix
Change-Id: I81695070533410c5815291dbc65ea71c87e3ae05
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
This commit is contained in:
Klement Sekera
2024-04-19 09:15:01 +02:00
parent db7be85352
commit 860916617d
7 changed files with 1063 additions and 587 deletions

View File

@@ -151,9 +151,8 @@ ip6_map_t_icmp (vlib_main_t * vm,
vnet_buffer (p0)->map_t.map_domain_index);
ctx0.d = d0;
ctx0.sender_port = 0;
if (!ip6_get_port
(vm, p0, ip60, p0->current_length, NULL, &ctx0.sender_port,
NULL, NULL, NULL, NULL))
if (!ip6_get_port (vm, p0, ip60, p0->current_length, NULL,
&ctx0.sender_port, NULL, NULL, NULL, NULL, NULL))
{
// In case of 1:1 mapping, we don't care about the port
if (!(d0->ea_bits_len == 0 && d0->rules))