aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2016-07-06 06:11:00 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-08 09:36:48 +0000
commit618ab08c4f0bccc4ceca6a8b18ea797fbe9fd5a7 (patch)
tree11d9c86a846dbfdb9b82235450442f56a90dd9be /vnet
parenta7775387b18ede6b9a0ddaa8c994d2401de0e238 (diff)
Reset IPFIX streams after configuration change
Reset IPFIX streams if reconfiguring IP addresses or collector port Change-Id: Idc914f90462572342d4ed02b538bb2d30b317931 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/flow/flow_report.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/vnet/vnet/flow/flow_report.c b/vnet/vnet/flow/flow_report.c
index b78df60a3c6..8cfbd59a900 100644
--- a/vnet/vnet/flow/flow_report.c
+++ b/vnet/vnet/flow/flow_report.c
@@ -211,6 +211,17 @@ int vnet_flow_report_add_del (flow_report_main_t *frm,
return 0;
}
+void vnet_flow_reports_reset (flow_report_main_t * frm)
+{
+ flow_report_t *fr;
+ vec_foreach (fr, frm->reports)
+ {
+ fr->sequence_number = 0;
+ fr->update_rewrite = 1;
+ fr->last_template_sent = 0;
+ }
+}
+
static clib_error_t *
set_ipfix_command_fn (vlib_main_t * vm,
unformat_input_t * input,
@@ -263,6 +274,12 @@ set_ipfix_command_fn (vlib_main_t * vm,
if (path_mtu < 68)
return clib_error_return (0, "too small path-mtu value, minimum is 68");
+ /* Reset report streams if we are reconfiguring IP addresses */
+ if (frm->ipfix_collector.as_u32 != collector.as_u32 ||
+ frm->src_address.as_u32 != src.as_u32 ||
+ frm->collector_port != collector_port)
+ vnet_flow_reports_reset(frm);
+
frm->ipfix_collector.as_u32 = collector.as_u32;
frm->collector_port = collector_port;
frm->src_address.as_u32 = src.as_u32;