flowprobe: fix sending L4 fields in L2 template and flows 36/40036/2
authorAlexander Chernavin <achernavin@netgate.com>
Tue, 17 Oct 2023 08:54:33 +0000 (08:54 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 1 Dec 2023 19:28:14 +0000 (19:28 +0000)
commit6cc757eff7b8c0d2bfaf6a8061c370d880fa89ca
tree578624b9cc5db0c6d63ac96323e4252b138bd3b2
parent9dc9136ec47459d5ce5e52e4b759b6a77fadde06
flowprobe: fix sending L4 fields in L2 template and flows

Currently, when L2 and L4 recording is enabled on the L2 datapath, the
L2 template will contain L4 fields and L2 flows will be exported with
those fields always set to zero.

With this fix, when L4 recording is enabled, add L4 fields to templates
other than the L2 template (i.e. to the IP4, IP6, L2_IP4, and L2_IP6
templates). And export L2 flows without L4 fields. Also, cover that case
in the tests.

Type: fix
Change-Id: Id5ed8b99af5634fb9d5c6e695203344782fdac01
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 6b027cfdbcb750b8aa1b8ab9a3904c1b2dca6f15)
src/plugins/flowprobe/flowprobe.c
src/plugins/flowprobe/node.c
test/test_flowprobe.py