diff options
author | Juraj Sloboda <jsloboda@cisco.com> | 2016-09-06 04:43:52 -0700 |
---|---|---|
committer | Juraj Sloboda <jsloboda@cisco.com> | 2016-09-07 00:06:01 -0700 |
commit | 24648ad088c4feea39f8e9fda82c35d207af45e0 (patch) | |
tree | a0a419a50959d81779edcb7849f34eb6d096a43d /vnet/vnet/flow/flow_report.c | |
parent | 7a35ee91a40e512b353f8f41f7a2d5fe32a29eca (diff) |
Fix bugs in IPFIX code discovered by coverity
Change-Id: Ibe6ccb99c3c29c14efb34191f209a2f6a14293f7
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'vnet/vnet/flow/flow_report.c')
-rw-r--r-- | vnet/vnet/flow/flow_report.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vnet/vnet/flow/flow_report.c b/vnet/vnet/flow/flow_report.c index 932613d338d..cbf1313d0e5 100644 --- a/vnet/vnet/flow/flow_report.c +++ b/vnet/vnet/flow/flow_report.c @@ -300,6 +300,26 @@ int vnet_flow_report_add_del (flow_report_main_t *frm, return 0; } +clib_error_t * flow_report_add_del_error_to_clib_error (int error) +{ + switch (error) + { + case 0: + return 0; + case VNET_API_ERROR_NO_SUCH_ENTRY: + return clib_error_return (0, "Flow report not found"); + case VNET_API_ERROR_VALUE_EXIST: + return clib_error_return (0, "Flow report already exists"); + case VNET_API_ERROR_INVALID_VALUE: + return clib_error_return (0, "Expecting either still unused values " + "for both domain_id and src_port " + "or already used values for both fields"); + default: + return clib_error_return (0, "vnet_flow_report_add_del returned %d", + error); + } +} + void vnet_flow_reports_reset (flow_report_main_t * frm) { flow_report_t *fr; |