summaryrefslogtreecommitdiff
path: root/bgpd/bgp_flowspec_util.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-19 14:57:19 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 20:02:05 +0000
commit4f3be6672ffa8fde728dc7f80810187088b8315c (patch)
tree33c09261adbd485ba66a2fd445be63258a2476ce /bgpd/bgp_flowspec_util.c
parent02705213b15f54b8601cd172e1b7123930575f86 (diff)
bgpd: Add some FLowspec specific Error Codes.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_flowspec_util.c')
-rw-r--r--bgpd/bgp_flowspec_util.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/bgpd/bgp_flowspec_util.c b/bgpd/bgp_flowspec_util.c
index 8286838dbb..c7432773b9 100644
--- a/bgpd/bgp_flowspec_util.c
+++ b/bgpd/bgp_flowspec_util.c
@@ -27,6 +27,7 @@
#include "bgp_flowspec_util.h"
#include "bgp_flowspec_private.h"
#include "bgp_pbr.h"
+#include "bgp_errors.h"
static void hex2bin(uint8_t *hex, int *bin)
{
@@ -67,8 +68,9 @@ static int bgp_flowspec_call_non_opaque_decode(uint8_t *nlri_content, int len,
len,
mval, error);
if (*error < 0)
- zlog_err("%s: flowspec_op_decode error %d",
- __func__, *error);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "%s: flowspec_op_decode error %d",
+ __func__, *error);
else
*match_num = *error;
return ret;
@@ -445,8 +447,9 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
len - offset,
prefix, &error);
if (error < 0)
- zlog_err("%s: flowspec_ip_address error %d",
- __func__, error);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "%s: flowspec_ip_address error %d",
+ __func__, error);
else
bpem->match_bitmask |= bitmask;
offset += ret;
@@ -539,8 +542,9 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
len - offset,
&bpem->tcpflags, &error);
if (error < 0)
- zlog_err("%s: flowspec_tcpflags_decode error %d",
- __func__, error);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "%s: flowspec_tcpflags_decode error %d",
+ __func__, error);
else
bpem->match_tcpflags_num = error;
/* contains the number of slots used */
@@ -553,8 +557,9 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
len - offset, &bpem->fragment,
&error);
if (error < 0)
- zlog_err("%s: flowspec_fragment_type_decode error %d",
- __func__, error);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "%s: flowspec_fragment_type_decode error %d",
+ __func__, error);
else
bpem->match_fragment_num = error;
offset += ret;