summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_flowspec.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-19 20:57:19 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit4f3be6672ffa8fde728dc7f80810187088b8315c (patch)
tree33c09261adbd485ba66a2fd445be63258a2476ce /bgpd/bgp_flowspec.c
parentbgpd: Convert to using LIB_ERR_XXX where possible (diff)
downloadfrr-4f3be6672ffa8fde728dc7f80810187088b8315c.tar.xz
frr-4f3be6672ffa8fde728dc7f80810187088b8315c.zip
bgpd: Add some FLowspec specific Error Codes.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_flowspec.c')
-rw-r--r--bgpd/bgp_flowspec.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c
index b578370db..b586e86a2 100644
--- a/bgpd/bgp_flowspec.c
+++ b/bgpd/bgp_flowspec.c
@@ -31,6 +31,7 @@
#include "bgpd/bgp_flowspec_private.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/bgp_debug.h"
+#include "bgpd/bgp_errors.h"
static int bgp_fs_nlri_validate(uint8_t *nlri_content, uint32_t len)
{
@@ -109,8 +110,9 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
}
if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT) {
- zlog_err("BGP flowspec nlri length maximum reached (%u)",
- packet->length);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "BGP flowspec nlri length maximum reached (%u)",
+ packet->length);
return -1;
}
@@ -126,12 +128,14 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
/* When packet overflow occur return immediately. */
if (pnt + psize > lim) {
- zlog_err("Flowspec NLRI length inconsistent ( size %u seen)",
- psize);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "Flowspec NLRI length inconsistent ( size %u seen)",
+ psize);
return -1;
}
if (bgp_fs_nlri_validate(pnt, psize) < 0) {
- zlog_err("Bad flowspec format or NLRI options not supported");
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "Bad flowspec format or NLRI options not supported");
return -1;
}
p.family = AF_FLOWSPEC;
@@ -184,8 +188,9 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
NULL, NULL, 0, NULL);
if (ret) {
- zlog_err("Flowspec NLRI failed to be %s.",
- attr ? "added" : "withdrawn");
+ zlog_ferr(BGP_ERR_FLOWSPEC_INSTALLATION,
+ "Flowspec NLRI failed to be %s.",
+ attr ? "added" : "withdrawn");
return -1;
}
}