diff options
author | Alexander Chernavin <achernavin@netgate.com> | 2023-10-26 11:18:19 +0000 |
---|---|---|
committer | Matthew Smith <mgsmith@netgate.com> | 2023-10-30 13:32:50 +0000 |
commit | 21922cec7339f48989f230248de36a98816c4b1b (patch) | |
tree | 6bc384314e1190e80424bb049b5da459ec35814b /src/plugins/flowprobe | |
parent | 4197fb95f29a934034833534f1b0bf414e889fcf (diff) |
flowprobe: fix accumulation of tcp flags in flow entries
Currently, TCP flags of a flow entry don't get reset once the flow is
exported (unlike other meta information about a flow - packet delta
count and octet delta count). So TCP flags are accumulated as long as
the flow is active. When the flow expires, it is exported the last time,
and its pool entry is freed for further reuse. The next flow that gets
this pool entry will already have non-zero TCP flags. If it's a TCP
flow, the flags will keep being accumulated. This might look fine when
exported. If it's a non-TCP flow, that will definitely look erroneous.
With this fix, reset TCP flags once the flow is exported. Also, cover
the reuse case with tests.
Type: fix
Change-Id: I5f8560afffcfe107909117d3d063e8a69793437e
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/plugins/flowprobe')
-rw-r--r-- | src/plugins/flowprobe/node.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c index 8466eda3792..274ea388ccd 100644 --- a/src/plugins/flowprobe/node.c +++ b/src/plugins/flowprobe/node.c @@ -740,6 +740,7 @@ flowprobe_export_entry (vlib_main_t * vm, flowprobe_entry_t * e) e->packetcount = 0; e->octetcount = 0; e->last_exported = vlib_time_now (vm); + e->prot.tcp.flags = 0; b0->current_length = offset; |