From 67ec752917ad95184f07ab67a67ada3f6265b48c Mon Sep 17 00:00:00 2001 From: Alexander Chernavin Date: Thu, 1 Oct 2020 08:57:59 -0400 Subject: [PATCH] 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 Change-Id: I1335c0d06af81f11d743c395399a360c612c0c21 --- src/vnet/ipfix-export/flow_api.c | 8 +------- 1 file changed, 1 insertion(+), 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; -- 2.16.6