.description = "BGP configuration has AS and process name mismatch",
.suggestion = "Correct the configuration so that the BGP AS number and instance\nname are consistent"
},
+ {
+ .code = BGP_ERR_FLOWSPEC_PACKET,
+ .title = "BGP Flowspec packet processing error",
+ .description = "The BGP flowspec subsystem has detected a error in the send or receive of a packet",
+ .suggestion = "Gather log files from both sides of the peering relationship and open an issue"
+ },
+ {
+ .code = BGP_ERR_FLOWSPEC_INSTALLATION,
+ .title = "BGP Flowspec Installation/removal Error",
+ .description = "The BGP flowspec subsystem has detected that there was a failure for installation/removal/modification of Flowspec from the dataplane",
+ .suggestion = "Gather log files from the router and open an issue, Restart FRR"
+ },
{
.code = END_FERR,
}
BGP_ERR_MULTI_INSTANCE,
BGP_ERR_EVPN_AS_MISMATCH,
BGP_ERR_EVPN_INSTANCE_MISMATCH,
+ BGP_ERR_FLOWSPEC_PACKET,
+ BGP_ERR_FLOWSPEC_INSTALLATION,
};
extern void bgp_error_init(void);
#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)
{
}
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;
}
/* 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;
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;
}
}
#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)
{
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;
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;
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 */
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;
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_flowspec_private.h"
+#include "bgpd/bgp_errors.h"
DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH_ENTRY, "PBR match entry")
DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH, "PBR match")
action_count++;
if (action_count > ACTIONS_MAX_NUM) {
if (BGP_DEBUG(pbr, PBR_ERROR))
- zlog_err("%s: flowspec actions exceeds limit (max %u)",
- __func__, action_count);
+ zlog_ferr(BGP_ERR_FLOWSPEC_PACKET,
+ "%s: flowspec actions exceeds limit (max %u)",
+ __func__, action_count);
break;
}
api_action = &api->actions[action_count - 1];
if (!bgp_zebra_tm_chunk_obtained()) {
if (BGP_DEBUG(pbr, PBR_ERROR))
- zlog_err("%s: table chunk not obtained yet",
- __func__);
+ zlog_ferr(BGP_ERR_TABLE_CHUNK,
+ "%s: table chunk not obtained yet",
+ __func__);
return;
}
if (bgp_pbr_build_and_validate_entry(p, info, &api) < 0) {
if (BGP_DEBUG(pbr, PBR_ERROR))
- zlog_err("%s: cancel updating entry %p in bgp pbr",
- __func__, info);
+ zlog_ferr(BGP_ERR_FLOWSPEC_INSTALLATION,
+ "%s: cancel updating entry %p in bgp pbr",
+ __func__, info);
return;
}
bgp_pbr_handle_entry(bgp, info, &api, nlri_update);