diff options
Diffstat (limited to 'bgpd/bgp_flowspec.c')
| -rw-r--r-- | bgpd/bgp_flowspec.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c index 2d336fa6d8..6695596c6f 100644 --- a/bgpd/bgp_flowspec.c +++ b/bgpd/bgp_flowspec.c @@ -22,6 +22,7 @@ #include <zebra.h> #include "prefix.h" +#include "lib_errors.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_route.h" @@ -30,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) { @@ -102,13 +104,15 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr, safi = packet->safi; if (afi == AFI_IP6) { - zlog_err("BGP flowspec IPv6 not supported"); + flog_err(LIB_ERR_DEVELOPMENT, + "BGP flowspec IPv6 not supported"); return -1; } if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT) { - zlog_err("BGP flowspec nlri length maximum reached (%u)", - packet->length); + flog_err(BGP_ERR_FLOWSPEC_PACKET, + "BGP flowspec nlri length maximum reached (%u)", + packet->length); return -1; } @@ -124,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); + flog_err(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"); + flog_err(BGP_ERR_FLOWSPEC_PACKET, + "Bad flowspec format or NLRI options not supported"); return -1; } p.family = AF_FLOWSPEC; @@ -182,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"); + flog_err(BGP_ERR_FLOWSPEC_INSTALLATION, + "Flowspec NLRI failed to be %s.", + attr ? "added" : "withdrawn"); return -1; } } |
