aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2020-10-01 08:57:59 -0400
committerMatthew Smith <mgsmith@netgate.com>2020-10-01 21:23:53 +0000
commit67ec752917ad95184f07ab67a67ada3f6265b48c (patch)
tree2f32a1f892a0a8a1955054e0d8a849c528bb8034
parent433a498683506e4e22b8304db22efb56ef24bdf9 (diff)
misc: allow disabling of ipfix exporter via api
Zero collector address indicates that the IPFIX exporter is disabled. You can zero the collector address via vppctl but you can't do it via the API because the handler returns an error if the address is zero. With this change, do not return an error in the handler when the collector address is zero thus allowing the IPFIX exporter be disabled. Type: fix Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I1335c0d06af81f11d743c395399a360c612c0c21
-rw-r--r--src/vnet/ipfix-export/flow_api.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/vnet/ipfix-export/flow_api.c b/src/vnet/ipfix-export/flow_api.c
index 84babe7dcdc..217cf31d691 100644
--- a/src/vnet/ipfix-export/flow_api.c
+++ b/src/vnet/ipfix-export/flow_api.c
@@ -113,13 +113,7 @@ vl_api_set_ipfix_exporter_t_handler (vl_api_set_ipfix_exporter_t * mp)
template_interval = 20;
udp_checksum = mp->udp_checksum;
- if (collector.as_u32 == 0)
- {
- rv = VNET_API_ERROR_INVALID_VALUE;
- goto out;
- }
-
- if (src.as_u32 == 0)
+ if (collector.as_u32 != 0 && src.as_u32 == 0)
{
rv = VNET_API_ERROR_INVALID_VALUE;
goto out;