flowprobe: fix sending L4 fields in L2 template and flows 85/39685/3
authorAlexander Chernavin <achernavin@netgate.com>
Tue, 17 Oct 2023 08:54:33 +0000 (08:54 +0000)
committerMatthew Smith <mgsmith@netgate.com>
Wed, 18 Oct 2023 21:01:03 +0000 (21:01 +0000)
commit6b027cfdbcb750b8aa1b8ab9a3904c1b2dca6f15
tree7896cad6fa7cb08cd0cdb17da07941ac166e0298
parent34c721fb47155135bf2173ca7b9a31aaacfde190
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>
src/plugins/flowprobe/flowprobe.c
src/plugins/flowprobe/node.c
test/test_flowprobe.py