flowprobe: fix sending L2 flows using L2_IP6 template 33/40033/2
authorAlexander Chernavin <achernavin@netgate.com>
Wed, 11 Oct 2023 12:15:55 +0000 (12:15 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 1 Dec 2023 19:19:44 +0000 (19:19 +0000)
commit70591c147d11bc55c64c15546158c31ced3cd1df
tree9195508dbe2ce55a9b01b38d86437d15a069df69
parent6c2464d0327f6d3fcaae67d209ae99e1c3069592
flowprobe: fix sending L2 flows using L2_IP6 template

Currently, L2 flows are exported using L2_IP6 template if L3 or L4
recording is enabled on L2 datapath. That occurs because during feature
enable, L2 template is added and its ID is not saved immediately. Then
L2_IP4 and L2_IP6 templates are added overwriting "template_id" each
time. And in the end, the current value of "template_id" is saved for L2
template. The problem is that "template_id" at that point contains the
ID of L2_IP6 template.

With this fix, save the template ID immediately after adding a template
for all variants (datapaths). Also, cover the case with a test.

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