bgpd: BGP_[WARN|ERR] -> EC_BGP

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2018-09-13 18:23:42 +00:00
parent 6efca3442f
commit e50f7cfdbd
26 changed files with 336 additions and 336 deletions

View File

@ -1640,7 +1640,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
if (hops < 0) { if (hops < 0) {
if (BGP_DEBUG(as4, AS4)) if (BGP_DEBUG(as4, AS4))
flog_warn( flog_warn(
BGP_WARN_ASPATH_FEWER_HOPS, EC_BGP_ASPATH_FEWER_HOPS,
"[AS4] Fewer hops in AS_PATH than NEW_AS_PATH"); "[AS4] Fewer hops in AS_PATH than NEW_AS_PATH");
/* Something's gone wrong. The RFC says we should now ignore /* Something's gone wrong. The RFC says we should now ignore
* AS4_PATH, * AS4_PATH,

View File

@ -998,7 +998,7 @@ bgp_attr_flags_diagnose(struct bgp_attr_parser_args *args,
if (CHECK_FLAG(desired_flags, attr_flag_str[i].key) if (CHECK_FLAG(desired_flags, attr_flag_str[i].key)
!= CHECK_FLAG(real_flags, attr_flag_str[i].key)) { != CHECK_FLAG(real_flags, attr_flag_str[i].key)) {
flog_err( flog_err(
BGP_ERR_ATTR_FLAG, EC_BGP_ATTR_FLAG,
"%s attribute must%s be flagged as \"%s\"", "%s attribute must%s be flagged as \"%s\"",
lookup_msg(attr_str, attr_code, NULL), lookup_msg(attr_str, attr_code, NULL),
CHECK_FLAG(desired_flags, attr_flag_str[i].key) CHECK_FLAG(desired_flags, attr_flag_str[i].key)
@ -1063,7 +1063,7 @@ static int bgp_attr_flag_invalid(struct bgp_attr_parser_args *args)
if (!CHECK_FLAG(BGP_ATTR_FLAG_OPTIONAL, flags) if (!CHECK_FLAG(BGP_ATTR_FLAG_OPTIONAL, flags)
&& !CHECK_FLAG(BGP_ATTR_FLAG_TRANS, flags)) { && !CHECK_FLAG(BGP_ATTR_FLAG_TRANS, flags)) {
flog_err( flog_err(
BGP_ERR_ATTR_FLAG, EC_BGP_ATTR_FLAG,
"%s well-known attributes must have transitive flag set (%x)", "%s well-known attributes must have transitive flag set (%x)",
lookup_msg(attr_str, attr_code, NULL), flags); lookup_msg(attr_str, attr_code, NULL), flags);
return 1; return 1;
@ -1075,7 +1075,7 @@ static int bgp_attr_flag_invalid(struct bgp_attr_parser_args *args)
*/ */
if (CHECK_FLAG(flags, BGP_ATTR_FLAG_PARTIAL)) { if (CHECK_FLAG(flags, BGP_ATTR_FLAG_PARTIAL)) {
if (!CHECK_FLAG(flags, BGP_ATTR_FLAG_OPTIONAL)) { if (!CHECK_FLAG(flags, BGP_ATTR_FLAG_OPTIONAL)) {
flog_err(BGP_ERR_ATTR_FLAG, flog_err(EC_BGP_ATTR_FLAG,
"%s well-known attribute " "%s well-known attribute "
"must NOT have the partial flag set (%x)", "must NOT have the partial flag set (%x)",
lookup_msg(attr_str, attr_code, NULL), flags); lookup_msg(attr_str, attr_code, NULL), flags);
@ -1083,7 +1083,7 @@ static int bgp_attr_flag_invalid(struct bgp_attr_parser_args *args)
} }
if (CHECK_FLAG(flags, BGP_ATTR_FLAG_OPTIONAL) if (CHECK_FLAG(flags, BGP_ATTR_FLAG_OPTIONAL)
&& !CHECK_FLAG(flags, BGP_ATTR_FLAG_TRANS)) { && !CHECK_FLAG(flags, BGP_ATTR_FLAG_TRANS)) {
flog_err(BGP_ERR_ATTR_FLAG, flog_err(EC_BGP_ATTR_FLAG,
"%s optional + transitive attribute " "%s optional + transitive attribute "
"must NOT have the partial flag set (%x)", "must NOT have the partial flag set (%x)",
lookup_msg(attr_str, attr_code, NULL), flags); lookup_msg(attr_str, attr_code, NULL), flags);
@ -1118,7 +1118,7 @@ static bgp_attr_parse_ret_t bgp_attr_origin(struct bgp_attr_parser_args *args)
field contains the erroneous attribute (type, length and field contains the erroneous attribute (type, length and
value). */ value). */
if (length != 1) { if (length != 1) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"Origin attribute length is not one %d", length); "Origin attribute length is not one %d", length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
args->total); args->total);
@ -1132,7 +1132,7 @@ static bgp_attr_parse_ret_t bgp_attr_origin(struct bgp_attr_parser_args *args)
contains the unrecognized attribute (type, length and value). */ contains the unrecognized attribute (type, length and value). */
if ((attr->origin != BGP_ORIGIN_IGP) && (attr->origin != BGP_ORIGIN_EGP) if ((attr->origin != BGP_ORIGIN_IGP) && (attr->origin != BGP_ORIGIN_EGP)
&& (attr->origin != BGP_ORIGIN_INCOMPLETE)) { && (attr->origin != BGP_ORIGIN_INCOMPLETE)) {
flog_err(BGP_ERR_ATTR_ORIGIN, flog_err(EC_BGP_ATTR_ORIGIN,
"Origin attribute value is invalid %d", attr->origin); "Origin attribute value is invalid %d", attr->origin);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_INVAL_ORIGIN, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_INVAL_ORIGIN,
args->total); args->total);
@ -1161,7 +1161,7 @@ static int bgp_attr_aspath(struct bgp_attr_parser_args *args)
/* In case of IBGP, length will be zero. */ /* In case of IBGP, length will be zero. */
if (!attr->aspath) { if (!attr->aspath) {
flog_err(BGP_ERR_ATTR_MAL_AS_PATH, flog_err(EC_BGP_ATTR_MAL_AS_PATH,
"Malformed AS path from %s, length is %d", peer->host, "Malformed AS path from %s, length is %d", peer->host,
length); length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_MAL_AS_PATH, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_MAL_AS_PATH,
@ -1191,7 +1191,7 @@ static bgp_attr_parse_ret_t bgp_attr_aspath_check(struct peer *const peer,
&& !aspath_left_confed_check(attr->aspath)) && !aspath_left_confed_check(attr->aspath))
|| (peer->sort == BGP_PEER_EBGP || (peer->sort == BGP_PEER_EBGP
&& aspath_confed_check(attr->aspath))) { && aspath_confed_check(attr->aspath))) {
flog_err(BGP_ERR_ATTR_MAL_AS_PATH, "Malformed AS path from %s", flog_err(EC_BGP_ATTR_MAL_AS_PATH, "Malformed AS path from %s",
peer->host); peer->host);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_AS_PATH); BGP_NOTIFY_UPDATE_MAL_AS_PATH);
@ -1202,7 +1202,7 @@ static bgp_attr_parse_ret_t bgp_attr_aspath_check(struct peer *const peer,
if (CHECK_FLAG(peer->flags, PEER_FLAG_ENFORCE_FIRST_AS)) { if (CHECK_FLAG(peer->flags, PEER_FLAG_ENFORCE_FIRST_AS)) {
if (peer->sort == BGP_PEER_EBGP if (peer->sort == BGP_PEER_EBGP
&& !aspath_firstas_check(attr->aspath, peer->as)) { && !aspath_firstas_check(attr->aspath, peer->as)) {
flog_err(BGP_ERR_ATTR_FIRST_AS, flog_err(EC_BGP_ATTR_FIRST_AS,
"%s incorrect first AS (must be %u)", "%s incorrect first AS (must be %u)",
peer->host, peer->as); peer->host, peer->as);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -1236,7 +1236,7 @@ static int bgp_attr_as4_path(struct bgp_attr_parser_args *args,
/* In case of IBGP, length will be zero. */ /* In case of IBGP, length will be zero. */
if (!*as4_path) { if (!*as4_path) {
flog_err(BGP_ERR_ATTR_MAL_AS_PATH, flog_err(EC_BGP_ATTR_MAL_AS_PATH,
"Malformed AS4 path from %s, length is %d", "Malformed AS4 path from %s, length is %d",
peer->host, length); peer->host, length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_MAL_AS_PATH, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_MAL_AS_PATH,
@ -1260,7 +1260,7 @@ static bgp_attr_parse_ret_t bgp_attr_nexthop(struct bgp_attr_parser_args *args)
/* Check nexthop attribute length. */ /* Check nexthop attribute length. */
if (length != 4) { if (length != 4) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"Nexthop attribute length isn't four [%d]", length); "Nexthop attribute length isn't four [%d]", length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
@ -1285,7 +1285,7 @@ static bgp_attr_parse_ret_t bgp_attr_nexthop(struct bgp_attr_parser_args *args)
{ {
char buf[INET_ADDRSTRLEN]; char buf[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &nexthop_n, buf, INET_ADDRSTRLEN); inet_ntop(AF_INET, &nexthop_n, buf, INET_ADDRSTRLEN);
flog_err(BGP_ERR_ATTR_MARTIAN_NH, "Martian nexthop %s", buf); flog_err(EC_BGP_ATTR_MARTIAN_NH, "Martian nexthop %s", buf);
return bgp_attr_malformed( return bgp_attr_malformed(
args, BGP_NOTIFY_UPDATE_INVAL_NEXT_HOP, args->total); args, BGP_NOTIFY_UPDATE_INVAL_NEXT_HOP, args->total);
} }
@ -1305,7 +1305,7 @@ static bgp_attr_parse_ret_t bgp_attr_med(struct bgp_attr_parser_args *args)
/* Length check. */ /* Length check. */
if (length != 4) { if (length != 4) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"MED attribute length isn't four [%d]", length); "MED attribute length isn't four [%d]", length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
@ -1329,7 +1329,7 @@ bgp_attr_local_pref(struct bgp_attr_parser_args *args)
/* Length check. */ /* Length check. */
if (length != 4) { if (length != 4) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"LOCAL_PREF attribute length isn't 4 [%u]", length); "LOCAL_PREF attribute length isn't 4 [%u]", length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
args->total); args->total);
@ -1359,7 +1359,7 @@ static int bgp_attr_atomic(struct bgp_attr_parser_args *args)
/* Length check. */ /* Length check. */
if (length != 0) { if (length != 0) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"ATOMIC_AGGREGATE attribute length isn't 0 [%u]", "ATOMIC_AGGREGATE attribute length isn't 0 [%u]",
length); length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
@ -1386,7 +1386,7 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args)
wantedlen = 8; wantedlen = 8;
if (length != wantedlen) { if (length != wantedlen) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"AGGREGATOR attribute length isn't %u [%u]", "AGGREGATOR attribute length isn't %u [%u]",
wantedlen, length); wantedlen, length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
@ -1416,7 +1416,7 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
const bgp_size_t length = args->length; const bgp_size_t length = args->length;
if (length != 8) { if (length != 8) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"New Aggregator length is not 8 [%d]", length); "New Aggregator length is not 8 [%d]", length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
0); 0);
@ -1576,7 +1576,7 @@ bgp_attr_originator_id(struct bgp_attr_parser_args *args)
/* Length check. */ /* Length check. */
if (length != 4) { if (length != 4) {
flog_err(BGP_ERR_ATTR_LEN, "Bad originator ID length %d", flog_err(EC_BGP_ATTR_LEN, "Bad originator ID length %d",
length); length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
@ -1600,7 +1600,7 @@ bgp_attr_cluster_list(struct bgp_attr_parser_args *args)
/* Check length. */ /* Check length. */
if (length % 4) { if (length % 4) {
flog_err(BGP_ERR_ATTR_LEN, "Bad cluster list length %d", flog_err(EC_BGP_ATTR_LEN, "Bad cluster list length %d",
length); length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
@ -1761,7 +1761,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
uint8_t val; uint8_t val;
if ((val = stream_getc(s))) if ((val = stream_getc(s)))
flog_warn( flog_warn(
BGP_WARN_DEFUNCT_SNPA_LEN, EC_BGP_DEFUNCT_SNPA_LEN,
"%s sent non-zero value, %u, for defunct SNPA-length field", "%s sent non-zero value, %u, for defunct SNPA-length field",
peer->host, val); peer->host, val);
} }
@ -2072,7 +2072,7 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(int32_t type,
if (type == BGP_PREFIX_SID_LABEL_INDEX) { if (type == BGP_PREFIX_SID_LABEL_INDEX) {
if (length != BGP_PREFIX_SID_LABEL_INDEX_LENGTH) { if (length != BGP_PREFIX_SID_LABEL_INDEX_LENGTH) {
flog_err( flog_err(
BGP_ERR_ATTR_LEN, EC_BGP_ATTR_LEN,
"Prefix SID label index length is %d instead of %d", "Prefix SID label index length is %d instead of %d",
length, BGP_PREFIX_SID_LABEL_INDEX_LENGTH); length, BGP_PREFIX_SID_LABEL_INDEX_LENGTH);
return bgp_attr_malformed(args, return bgp_attr_malformed(args,
@ -2107,7 +2107,7 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(int32_t type,
/* Placeholder code for the IPv6 SID type */ /* Placeholder code for the IPv6 SID type */
else if (type == BGP_PREFIX_SID_IPV6) { else if (type == BGP_PREFIX_SID_IPV6) {
if (length != BGP_PREFIX_SID_IPV6_LENGTH) { if (length != BGP_PREFIX_SID_IPV6_LENGTH) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"Prefix SID IPv6 length is %d instead of %d", "Prefix SID IPv6 length is %d instead of %d",
length, BGP_PREFIX_SID_IPV6_LENGTH); length, BGP_PREFIX_SID_IPV6_LENGTH);
return bgp_attr_malformed(args, return bgp_attr_malformed(args,
@ -2131,7 +2131,7 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(int32_t type,
if (length % BGP_PREFIX_SID_ORIGINATOR_SRGB_LENGTH) { if (length % BGP_PREFIX_SID_ORIGINATOR_SRGB_LENGTH) {
flog_err( flog_err(
BGP_ERR_ATTR_LEN, EC_BGP_ATTR_LEN,
"Prefix SID Originator SRGB length is %d, it must be a multiple of %d ", "Prefix SID Originator SRGB length is %d, it must be a multiple of %d ",
length, BGP_PREFIX_SID_ORIGINATOR_SRGB_LENGTH); length, BGP_PREFIX_SID_ORIGINATOR_SRGB_LENGTH);
return bgp_attr_malformed( return bgp_attr_malformed(
@ -2181,7 +2181,7 @@ bgp_attr_prefix_sid(int32_t tlength, struct bgp_attr_parser_args *args,
if (tlength < 0) { if (tlength < 0) {
flog_err( flog_err(
BGP_ERR_ATTR_LEN, EC_BGP_ATTR_LEN,
"Prefix SID internal length %d causes us to read beyond the total Prefix SID length", "Prefix SID internal length %d causes us to read beyond the total Prefix SID length",
length); length);
return bgp_attr_malformed(args, return bgp_attr_malformed(args,
@ -2208,7 +2208,7 @@ bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args)
* can only support that. * can only support that.
*/ */
if (length < 2) { if (length < 2) {
flog_err(BGP_ERR_ATTR_LEN, flog_err(EC_BGP_ATTR_LEN,
"Bad PMSI tunnel attribute length %d", length); "Bad PMSI tunnel attribute length %d", length);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_ATTR_LENG_ERR,
args->total); args->total);
@ -2216,14 +2216,14 @@ bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args)
stream_getc(peer->curr); /* Flags */ stream_getc(peer->curr); /* Flags */
tnl_type = stream_getc(peer->curr); tnl_type = stream_getc(peer->curr);
if (tnl_type > PMSI_TNLTYPE_MAX) { if (tnl_type > PMSI_TNLTYPE_MAX) {
flog_err(BGP_ERR_ATTR_PMSI_TYPE, flog_err(EC_BGP_ATTR_PMSI_TYPE,
"Invalid PMSI tunnel attribute type %d", tnl_type); "Invalid PMSI tunnel attribute type %d", tnl_type);
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total); args->total);
} }
if (tnl_type == PMSI_TNLTYPE_INGR_REPL) { if (tnl_type == PMSI_TNLTYPE_INGR_REPL) {
if (length != 9) { if (length != 9) {
flog_err(BGP_ERR_ATTR_PMSI_LEN, flog_err(EC_BGP_ATTR_PMSI_LEN,
"Bad PMSI tunnel attribute length %d for IR", "Bad PMSI tunnel attribute length %d for IR",
length); length);
return bgp_attr_malformed( return bgp_attr_malformed(
@ -2337,7 +2337,7 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr)
type = BGP_ATTR_LOCAL_PREF; type = BGP_ATTR_LOCAL_PREF;
if (type) { if (type) {
flog_warn(BGP_WARN_MISSING_ATTRIBUTE, flog_warn(EC_BGP_MISSING_ATTRIBUTE,
"%s Missing well-known attribute %s.", peer->host, "%s Missing well-known attribute %s.", peer->host,
lookup_msg(attr_str, type, NULL)); lookup_msg(attr_str, type, NULL));
bgp_notify_send_with_data(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send_with_data(peer, BGP_NOTIFY_UPDATE_ERR,
@ -2380,7 +2380,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
if (endp - BGP_INPUT_PNT(peer) < BGP_ATTR_MIN_LEN) { if (endp - BGP_INPUT_PNT(peer) < BGP_ATTR_MIN_LEN) {
/* XXX warning: long int format, int arg (arg 5) */ /* XXX warning: long int format, int arg (arg 5) */
flog_warn( flog_warn(
BGP_WARN_ATTRIBUTE_TOO_SMALL, EC_BGP_ATTRIBUTE_TOO_SMALL,
"%s: error BGP attribute length %lu is smaller than min len", "%s: error BGP attribute length %lu is smaller than min len",
peer->host, peer->host,
(unsigned long)(endp (unsigned long)(endp
@ -2403,7 +2403,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN) if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN)
&& ((endp - startp) < (BGP_ATTR_MIN_LEN + 1))) { && ((endp - startp) < (BGP_ATTR_MIN_LEN + 1))) {
flog_warn( flog_warn(
BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL, EC_BGP_EXT_ATTRIBUTE_TOO_SMALL,
"%s: Extended length set, but just %lu bytes of attr header", "%s: Extended length set, but just %lu bytes of attr header",
peer->host, peer->host,
(unsigned long)(endp (unsigned long)(endp
@ -2426,7 +2426,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
if (CHECK_BITMAP(seen, type)) { if (CHECK_BITMAP(seen, type)) {
flog_warn( flog_warn(
BGP_WARN_ATTRIBUTE_REPEATED, EC_BGP_ATTRIBUTE_REPEATED,
"%s: error BGP attribute type %d appears twice in a message", "%s: error BGP attribute type %d appears twice in a message",
peer->host, type); peer->host, type);
@ -2445,7 +2445,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
if (attr_endp > endp) { if (attr_endp > endp) {
flog_warn( flog_warn(
BGP_WARN_ATTRIBUTE_TOO_LARGE, EC_BGP_ATTRIBUTE_TOO_LARGE,
"%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p", "%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p",
peer->host, type, length, size, attr_endp, peer->host, type, length, size, attr_endp,
endp); endp);
@ -2602,7 +2602,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
/* If hard error occured immediately return to the caller. */ /* If hard error occured immediately return to the caller. */
if (ret == BGP_ATTR_PARSE_ERROR) { if (ret == BGP_ATTR_PARSE_ERROR) {
flog_warn(BGP_WARN_ATTRIBUTE_PARSE_ERROR, flog_warn(EC_BGP_ATTRIBUTE_PARSE_ERROR,
"%s: Attribute %s, parse error", peer->host, "%s: Attribute %s, parse error", peer->host,
lookup_msg(attr_str, type, NULL)); lookup_msg(attr_str, type, NULL));
if (as4_path) if (as4_path)
@ -2612,7 +2612,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
if (ret == BGP_ATTR_PARSE_WITHDRAW) { if (ret == BGP_ATTR_PARSE_WITHDRAW) {
flog_warn( flog_warn(
BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW, EC_BGP_ATTRIBUTE_PARSE_WITHDRAW,
"%s: Attribute %s, parse error - treating as withdrawal", "%s: Attribute %s, parse error - treating as withdrawal",
peer->host, lookup_msg(attr_str, type, NULL)); peer->host, lookup_msg(attr_str, type, NULL));
if (as4_path) if (as4_path)
@ -2622,7 +2622,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
/* Check the fetched length. */ /* Check the fetched length. */
if (BGP_INPUT_PNT(peer) != attr_endp) { if (BGP_INPUT_PNT(peer) != attr_endp) {
flog_warn(BGP_WARN_ATTRIBUTE_FETCH_ERROR, flog_warn(EC_BGP_ATTRIBUTE_FETCH_ERROR,
"%s: BGP attribute %s, fetch error", "%s: BGP attribute %s, fetch error",
peer->host, lookup_msg(attr_str, type, NULL)); peer->host, lookup_msg(attr_str, type, NULL));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -2635,7 +2635,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
/* Check final read pointer is same as end pointer. */ /* Check final read pointer is same as end pointer. */
if (BGP_INPUT_PNT(peer) != endp) { if (BGP_INPUT_PNT(peer) != endp) {
flog_warn(BGP_WARN_ATTRIBUTES_MISMATCH, flog_warn(EC_BGP_ATTRIBUTES_MISMATCH,
"%s: BGP attribute %s, length mismatch", peer->host, "%s: BGP attribute %s, length mismatch", peer->host,
lookup_msg(attr_str, type, NULL)); lookup_msg(attr_str, type, NULL));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -2831,7 +2831,7 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
default: default:
if (safi != SAFI_FLOWSPEC) if (safi != SAFI_FLOWSPEC)
flog_err( flog_err(
BGP_ERR_ATTR_NH_SEND_LEN, EC_BGP_ATTR_NH_SEND_LEN,
"Bad nexthop when sending to %s, AFI %u SAFI %u nhlen %d", "Bad nexthop when sending to %s, AFI %u SAFI %u nhlen %d",
peer->host, afi, safi, attr->mp_nexthop_len); peer->host, afi, safi, attr->mp_nexthop_len);
break; break;

View File

@ -120,7 +120,7 @@ static FILE *bgp_dump_open_file(struct bgp_dump *bgp_dump)
ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, tm); ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, tm);
if (ret == 0) { if (ret == 0) {
flog_warn(BGP_WARN_DUMP, "bgp_dump_open_file: strftime error"); flog_warn(EC_BGP_DUMP, "bgp_dump_open_file: strftime error");
return NULL; return NULL;
} }
@ -132,7 +132,7 @@ static FILE *bgp_dump_open_file(struct bgp_dump *bgp_dump)
bgp_dump->fp = fopen(realpath, "w"); bgp_dump->fp = fopen(realpath, "w");
if (bgp_dump->fp == NULL) { if (bgp_dump->fp == NULL) {
flog_warn(BGP_WARN_DUMP, "bgp_dump_open_file: %s: %s", realpath, flog_warn(EC_BGP_DUMP, "bgp_dump_open_file: %s: %s", realpath,
strerror(errno)); strerror(errno));
umask(oldumask); umask(oldumask);
return NULL; return NULL;

View File

@ -26,163 +26,163 @@
/* clang-format off */ /* clang-format off */
static struct log_ref ferr_bgp_warn[] = { static struct log_ref ferr_bgp_warn[] = {
{ {
.code = BGP_WARN_ASPATH_FEWER_HOPS, .code = EC_BGP_ASPATH_FEWER_HOPS,
.title = "BGP AS-path conversion has failed", .title = "BGP AS-path conversion has failed",
.description = "BGP has attempted to convert a AS2 to AS4 path and has failed", .description = "BGP has attempted to convert a AS2 to AS4 path and has failed",
.suggestion = "Open an Issue with all relevant log files and restart FRR" .suggestion = "Open an Issue with all relevant log files and restart FRR"
}, },
{ {
.code = BGP_WARN_DEFUNCT_SNPA_LEN, .code = EC_BGP_DEFUNCT_SNPA_LEN,
.title = "BGP has received a value in a reserved field", .title = "BGP has received a value in a reserved field",
.description = "BGP has received a non-zero value in a reserved field that was used for SNPA-length at one point in time", .description = "BGP has received a non-zero value in a reserved field that was used for SNPA-length at one point in time",
.suggestion = "BGP has peered with either a router that is attempting to send SNPA data or it has received a corrupted packet. If we are peering with a SNPA aware router(unlikely) upgrade that router, else open an Issue after gathering relevant log files", .suggestion = "BGP has peered with either a router that is attempting to send SNPA data or it has received a corrupted packet. If we are peering with a SNPA aware router(unlikely) upgrade that router, else open an Issue after gathering relevant log files",
}, },
{ {
.code = BGP_WARN_MISSING_ATTRIBUTE, .code = EC_BGP_MISSING_ATTRIBUTE,
.title = "BGP has received an update with missing a missing attribute", .title = "BGP has received an update with missing a missing attribute",
.description = "BGP received update packets must have some minimum attribute information within them", .description = "BGP received update packets must have some minimum attribute information within them",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTE_TOO_SMALL, .code = EC_BGP_ATTRIBUTE_TOO_SMALL,
.title = "BGP udate packet with attribute data that is too small", .title = "BGP udate packet with attribute data that is too small",
.description = "BGP has received an update packet that is too small to parse a given attribute. This typically means that something has gone wrong between us and the remote peer", .description = "BGP has received an update packet that is too small to parse a given attribute. This typically means that something has gone wrong between us and the remote peer",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL, .code = EC_BGP_EXT_ATTRIBUTE_TOO_SMALL,
.title = "BGP udate packet with extended attribute data that is too small", .title = "BGP udate packet with extended attribute data that is too small",
.description = "BGP has received an update packet that is too small to parse a given extended attribute. This typically means that something has gone wrong between us and the remote peer", .description = "BGP has received an update packet that is too small to parse a given extended attribute. This typically means that something has gone wrong between us and the remote peer",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTE_REPEATED, .code = EC_BGP_ATTRIBUTE_REPEATED,
.title = "BGP update packet received with a repeated attribute", .title = "BGP update packet received with a repeated attribute",
.description = "BGP has received an update packet with a attribute that is repeated more than one time for a particular route. This typically means that something has gone wrong between us and the remote peer", .description = "BGP has received an update packet with a attribute that is repeated more than one time for a particular route. This typically means that something has gone wrong between us and the remote peer",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTE_TOO_LARGE, .code = EC_BGP_ATTRIBUTE_TOO_LARGE,
.title = "BGP udate packet with attribute data that is too large", .title = "BGP udate packet with attribute data that is too large",
.description = "BGP has received an update packet that has too much data in a particular attribute. This typically means that something has gone wrong between us and the remote peer", .description = "BGP has received an update packet that has too much data in a particular attribute. This typically means that something has gone wrong between us and the remote peer",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTE_PARSE_ERROR, .code = EC_BGP_ATTRIBUTE_PARSE_ERROR,
.title = "BGP update packet with attribute data has a parse error, specific to the attribute", .title = "BGP update packet with attribute data has a parse error, specific to the attribute",
.description = "BGP has received an update packet with an attribute that when parsed does not make sense in some manner", .description = "BGP has received an update packet with an attribute that when parsed does not make sense in some manner",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW, .code = EC_BGP_ATTRIBUTE_PARSE_WITHDRAW,
.title = "BGP update packet with a broken optional attribute has caused a withdraw of associated routes", .title = "BGP update packet with a broken optional attribute has caused a withdraw of associated routes",
.description = "BGP has received a update packet with optional attributes that did not parse correctly, instead of resetting the peer, withdraw associated routes and note that this has happened", .description = "BGP has received a update packet with optional attributes that did not parse correctly, instead of resetting the peer, withdraw associated routes and note that this has happened",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTE_FETCH_ERROR, .code = EC_BGP_ATTRIBUTE_FETCH_ERROR,
.title = "BGP update packet with a broken length", .title = "BGP update packet with a broken length",
.description = "BGP has received a update packet with an attribute that has an incorrect length", .description = "BGP has received a update packet with an attribute that has an incorrect length",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_ATTRIBUTES_MISMATCH, .code = EC_BGP_ATTRIBUTES_MISMATCH,
.title = "BGP update packet with a length different than attribute data length", .title = "BGP update packet with a length different than attribute data length",
.description = "BGP has received a update packet with attributes that when parsed do not correctly add up to packet data length", .description = "BGP has received a update packet with attributes that when parsed do not correctly add up to packet data length",
.suggestion = "Gather log data from this and remote peer and open an Issue with this data", .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
}, },
{ {
.code = BGP_WARN_DUMP, .code = EC_BGP_DUMP,
.title = "BGP MRT dump subsystem has encountered an issue", .title = "BGP MRT dump subsystem has encountered an issue",
.description = "BGP has found that the attempted write of MRT data to a dump file has failed", .description = "BGP has found that the attempted write of MRT data to a dump file has failed",
.suggestion = "Ensure BGP has permissions to write the specified file", .suggestion = "Ensure BGP has permissions to write the specified file",
}, },
{ {
.code = BGP_WARN_UPDATE_PACKET_SHORT, .code = EC_BGP_UPDATE_PACKET_SHORT,
.title = "BGP Update Packet is to Small", .title = "BGP Update Packet is to Small",
.description = "The update packet received from a peer is to small", .description = "The update packet received from a peer is to small",
.suggestion = "Determine the source of the update packet and examine that peer for what has gone wrong", .suggestion = "Determine the source of the update packet and examine that peer for what has gone wrong",
}, },
{ {
.code = BGP_WARN_UPDATE_PACKET_LONG, .code = EC_BGP_UPDATE_PACKET_LONG,
.title = "BGP Update Packet is to large", .title = "BGP Update Packet is to large",
.description = "The update packet received from a peer is to large", .description = "The update packet received from a peer is to large",
.suggestion = "Determine the source of the update packet and examine that peer for what has gone wrong", .suggestion = "Determine the source of the update packet and examine that peer for what has gone wrong",
}, },
{ {
.code = BGP_WARN_UNRECOGNIZED_CAPABILITY, .code = EC_BGP_UNRECOGNIZED_CAPABILITY,
.title = "Unknown BGP Capability Received", .title = "Unknown BGP Capability Received",
.description = "The negotiation of capabilities has received a capability that we do not know what to do with", .description = "The negotiation of capabilities has received a capability that we do not know what to do with",
.suggestion = "Determine the source of the capability and remove the capability from what is sent", .suggestion = "Determine the source of the capability and remove the capability from what is sent",
}, },
{ {
.code = BGP_WARN_NO_TCP_MD5, .code = EC_BGP_NO_TCP_MD5,
.title = "Unable to set TCP MD5 option on socket", .title = "Unable to set TCP MD5 option on socket",
.description = "BGP attempted to setup TCP MD5 configuration on the socket as per configuration but was unable to", .description = "BGP attempted to setup TCP MD5 configuration on the socket as per configuration but was unable to",
.suggestion = "Please collect log files and open Issue", .suggestion = "Please collect log files and open Issue",
}, },
{ {
.code = BGP_WARN_NO_SOCKOPT_MARK, .code = EC_BGP_NO_SOCKOPT_MARK,
.title = "Unable to set socket MARK option", .title = "Unable to set socket MARK option",
.description = "BGP attempted to set the SO_MARK option for a socket and was unable to do so", .description = "BGP attempted to set the SO_MARK option for a socket and was unable to do so",
.suggestion = "Please collect log files and open Issue", .suggestion = "Please collect log files and open Issue",
}, },
{ {
.code = BGP_WARN_EVPN_PMSI_PRESENT, .code = EC_BGP_EVPN_PMSI_PRESENT,
.title = "BGP Received a EVPN NLRI with PMSI included", .title = "BGP Received a EVPN NLRI with PMSI included",
.description = "BGP has received a type-3 NLRI with PMSI information. At this time FRR is not capable of properly handling this NLRI type", .description = "BGP has received a type-3 NLRI with PMSI information. At this time FRR is not capable of properly handling this NLRI type",
.suggestion = "Setup peer to not send this type of data to FRR" .suggestion = "Setup peer to not send this type of data to FRR"
}, },
{ {
.code = BGP_WARN_EVPN_VPN_VNI, .code = EC_BGP_EVPN_VPN_VNI,
.title = "BGP has received a local macip and cannot properly handle it", .title = "BGP has received a local macip and cannot properly handle it",
.description = "BGP has received a local macip from zebra and has no way to properly handle the macip because the vni is not setup properly", .description = "BGP has received a local macip from zebra and has no way to properly handle the macip because the vni is not setup properly",
.suggestion = "Ensure proper setup of BGP EVPN", .suggestion = "Ensure proper setup of BGP EVPN",
}, },
{ {
.code = BGP_WARN_EVPN_ESI, .code = EC_BGP_EVPN_ESI,
.title = "BGP has received a local ESI for deletion", .title = "BGP has received a local ESI for deletion",
.description = "BGP has received a local ESI for deletion but when attempting to find the stored data internally was unable to find the information for deletion", .description = "BGP has received a local ESI for deletion but when attempting to find the stored data internally was unable to find the information for deletion",
.suggestion = "Gather logging and open an Issue", .suggestion = "Gather logging and open an Issue",
}, },
{ {
.code = BGP_WARN_INVALID_LABEL_STACK, .code = EC_BGP_INVALID_LABEL_STACK,
.title = "BGP has received a label stack in a NLRI that does not have the BOS marked", .title = "BGP has received a label stack in a NLRI that does not have the BOS marked",
.description = "BGP when it receives a NLRI with a label stack should have the BOS marked, this received packet does not have this", .description = "BGP when it receives a NLRI with a label stack should have the BOS marked, this received packet does not have this",
.suggestion = "Gather log information from here and remote peer and open an Issue", .suggestion = "Gather log information from here and remote peer and open an Issue",
}, },
{ {
.code = BGP_WARN_ZEBRA_SEND, .code = EC_BGP_ZEBRA_SEND,
.title = "BGP has attempted to send data to zebra and has failed to do so", .title = "BGP has attempted to send data to zebra and has failed to do so",
.description = "BGP has attempted to send data to zebra but has been unable to do so", .description = "BGP has attempted to send data to zebra but has been unable to do so",
.suggestion = "Gather log data, open an Issue and restart FRR" .suggestion = "Gather log data, open an Issue and restart FRR"
}, },
{ {
.code = BGP_WARN_CAPABILITY_INVALID_LENGTH, .code = EC_BGP_CAPABILITY_INVALID_LENGTH,
.title = "BGP has received a capability with an invalid length", .title = "BGP has received a capability with an invalid length",
.description = "BGP has received a capability from it's peer who's size is wrong", .description = "BGP has received a capability from it's peer who's size is wrong",
.suggestion = "Gather log files from here and from peer and open an Issue", .suggestion = "Gather log files from here and from peer and open an Issue",
}, },
{ {
.code = BGP_WARN_CAPABILITY_INVALID_DATA, .code = EC_BGP_CAPABILITY_INVALID_DATA,
.title = "BGP has received capability data with invalid information", .title = "BGP has received capability data with invalid information",
.description = "BGP has noticed that during processing of capability information that data was wrong", .description = "BGP has noticed that during processing of capability information that data was wrong",
.suggestion = "Gather log files from here and from peer and open an Issue", .suggestion = "Gather log files from here and from peer and open an Issue",
}, },
{ {
.code = BGP_WARN_CAPABILITY_VENDOR, .code = EC_BGP_CAPABILITY_VENDOR,
.title = "BGP has recieved capability data specific to a particular vendor", .title = "BGP has recieved capability data specific to a particular vendor",
.description = "BGP has received a capability that is vendor specific and as such we have no knowledge of how to use this capability in FRR", .description = "BGP has received a capability that is vendor specific and as such we have no knowledge of how to use this capability in FRR",
.suggestion = "On peer turn off this feature" .suggestion = "On peer turn off this feature"
}, },
{ {
.code = BGP_WARN_CAPABILITY_UNKNOWN, .code = EC_BGP_CAPABILITY_UNKNOWN,
.title = "BGP has received capability data for a unknown capability", .title = "BGP has received capability data for a unknown capability",
.description = "BGP has received a capability that it does not know how to decode. This may be due to a new feature that has not been coded into FRR or it may be a bug in the remote peer", .description = "BGP has received a capability that it does not know how to decode. This may be due to a new feature that has not been coded into FRR or it may be a bug in the remote peer",
.suggestion = "Gather log files from here and from peer and open an Issue", .suggestion = "Gather log files from here and from peer and open an Issue",
}, },
{ {
.code = BGP_WARN_INVALID_NEXTHOP_LENGTH, .code = EC_BGP_INVALID_NEXTHOP_LENGTH,
.title = "BGP is attempting to write an invalid nexthop length value", .title = "BGP is attempting to write an invalid nexthop length value",
.description = "BGP is in the process of building NLRI information for a peer and has discovered an inconsistent internal state", .description = "BGP is in the process of building NLRI information for a peer and has discovered an inconsistent internal state",
.suggestion = "Gather log files and open an Issue, restart FRR", .suggestion = "Gather log files and open an Issue, restart FRR",
@ -194,270 +194,270 @@ static struct log_ref ferr_bgp_warn[] = {
static struct log_ref ferr_bgp_err[] = { static struct log_ref ferr_bgp_err[] = {
{ {
.code = BGP_ERR_ATTR_FLAG, .code = EC_BGP_ATTR_FLAG,
.title = "BGP attribute flag is incorrect", .title = "BGP attribute flag is incorrect",
.description = "BGP attribute flag is set to the wrong value (Optional/Transitive/Partial)", .description = "BGP attribute flag is set to the wrong value (Optional/Transitive/Partial)",
.suggestion = "Determine the soure of the attribute and determine why the attribute flag has been set incorrectly" .suggestion = "Determine the soure of the attribute and determine why the attribute flag has been set incorrectly"
}, },
{ {
.code = BGP_ERR_ATTR_LEN, .code = EC_BGP_ATTR_LEN,
.title = "BGP attribute length is incorrect", .title = "BGP attribute length is incorrect",
.description = "BGP attribute length is incorrect", .description = "BGP attribute length is incorrect",
.suggestion = "Determine the soure of the attribute and determine why the attribute length has been set incorrectly" .suggestion = "Determine the soure of the attribute and determine why the attribute length has been set incorrectly"
}, },
{ {
.code = BGP_ERR_ATTR_ORIGIN, .code = EC_BGP_ATTR_ORIGIN,
.title = "BGP attribute origin value invalid", .title = "BGP attribute origin value invalid",
.description = "BGP attribute origin value is invalid", .description = "BGP attribute origin value is invalid",
.suggestion = "Determine the soure of the attribute and determine why the origin attribute has been set incorrectly" .suggestion = "Determine the soure of the attribute and determine why the origin attribute has been set incorrectly"
}, },
{ {
.code = BGP_ERR_ATTR_MAL_AS_PATH, .code = EC_BGP_ATTR_MAL_AS_PATH,
.title = "BGP as path is invalid", .title = "BGP as path is invalid",
.description = "BGP as path has been malformed", .description = "BGP as path has been malformed",
.suggestion = "Determine the soure of the update and determine why the as path has been set incorrectly" .suggestion = "Determine the soure of the update and determine why the as path has been set incorrectly"
}, },
{ {
.code = BGP_ERR_ATTR_FIRST_AS, .code = EC_BGP_ATTR_FIRST_AS,
.title = "BGP as path first as is invalid", .title = "BGP as path first as is invalid",
.description = "BGP update has invalid first as in as path", .description = "BGP update has invalid first as in as path",
.suggestion = "Determine the soure of the update and determine why the as path first as value has been set incorrectly" .suggestion = "Determine the soure of the update and determine why the as path first as value has been set incorrectly"
}, },
{ {
.code = BGP_ERR_ATTR_PMSI_TYPE, .code = EC_BGP_ATTR_PMSI_TYPE,
.title = "BGP PMSI tunnel attribute type is invalid", .title = "BGP PMSI tunnel attribute type is invalid",
.description = "BGP update has invalid type for PMSI tunnel", .description = "BGP update has invalid type for PMSI tunnel",
.suggestion = "Determine the soure of the update and determine why the PMSI tunnel attribute type has been set incorrectly" .suggestion = "Determine the soure of the update and determine why the PMSI tunnel attribute type has been set incorrectly"
}, },
{ {
.code = BGP_ERR_ATTR_PMSI_LEN, .code = EC_BGP_ATTR_PMSI_LEN,
.title = "BGP PMSI tunnel attribute length is invalid", .title = "BGP PMSI tunnel attribute length is invalid",
.description = "BGP update has invalid length for PMSI tunnel", .description = "BGP update has invalid length for PMSI tunnel",
.suggestion = "Determine the soure of the update and determine why the PMSI tunnel attribute length has been set incorrectly" .suggestion = "Determine the soure of the update and determine why the PMSI tunnel attribute length has been set incorrectly"
}, },
{ {
.code = BGP_ERR_PEER_GROUP, .code = EC_BGP_PEER_GROUP,
.title = "BGP peergroup operated on in error", .title = "BGP peergroup operated on in error",
.description = "BGP operating on peer-group instead of peers included", .description = "BGP operating on peer-group instead of peers included",
.suggestion = "Ensure the config doesn't contain peergroups contained within peergroups" .suggestion = "Ensure the config doesn't contain peergroups contained within peergroups"
}, },
{ {
.code = BGP_ERR_PEER_DELETE, .code = EC_BGP_PEER_DELETE,
.title = "BGP failed to delete peer structure", .title = "BGP failed to delete peer structure",
.description = "BGP was unable to delete peer structure when address-family removed", .description = "BGP was unable to delete peer structure when address-family removed",
.suggestion = "Determine if all expected peers are removed and restart FRR if not. Most likely a bug" .suggestion = "Determine if all expected peers are removed and restart FRR if not. Most likely a bug"
}, },
{ {
.code = BGP_ERR_TABLE_CHUNK, .code = EC_BGP_TABLE_CHUNK,
.title = "BGP failed to get table chunk memory", .title = "BGP failed to get table chunk memory",
.description = "BGP unable to get chunk memory for table manager", .description = "BGP unable to get chunk memory for table manager",
.suggestion = "Ensure there is adequate memory on the device to support the table requirements" .suggestion = "Ensure there is adequate memory on the device to support the table requirements"
}, },
{ {
.code = BGP_ERR_MACIP_LEN, .code = EC_BGP_MACIP_LEN,
.title = "BGP received MACIP with invalid IP addr len", .title = "BGP received MACIP with invalid IP addr len",
.description = "BGP received MACIP with invalid IP addr len from Zebra", .description = "BGP received MACIP with invalid IP addr len from Zebra",
.suggestion = "Verify MACIP entries inserted in Zebra are correct. Most likely a bug" .suggestion = "Verify MACIP entries inserted in Zebra are correct. Most likely a bug"
}, },
{ {
.code = BGP_ERR_LM_ERROR, .code = EC_BGP_LM_ERROR,
.title = "BGP received invalid label manager message", .title = "BGP received invalid label manager message",
.description = "BGP received invalid label manager message from label manager", .description = "BGP received invalid label manager message from label manager",
.suggestion = "Label manager sent invalid essage to BGP for wrong protocol, instance, etc. Most likely a bug" .suggestion = "Label manager sent invalid essage to BGP for wrong protocol, instance, etc. Most likely a bug"
}, },
{ {
.code = BGP_ERR_JSON_MEM_ERROR, .code = EC_BGP_JSON_MEM_ERROR,
.title = "BGP unable to allocate memory for JSON output", .title = "BGP unable to allocate memory for JSON output",
.description = "BGP attempted to generate JSON output and was unable to allocate the memory required", .description = "BGP attempted to generate JSON output and was unable to allocate the memory required",
.suggestion = "Ensure that the device has adequate memory to suport the required functions" .suggestion = "Ensure that the device has adequate memory to suport the required functions"
}, },
{ {
.code = BGP_ERR_UPDGRP_ATTR_LEN, .code = EC_BGP_UPDGRP_ATTR_LEN,
.title = "BGP update had attributes too long to send", .title = "BGP update had attributes too long to send",
.description = "BGP attempted to send an update but the attributes were too long to fit", .description = "BGP attempted to send an update but the attributes were too long to fit",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_UPDGRP_CREATE, .code = EC_BGP_UPDGRP_CREATE,
.title = "BGP update group creation failed", .title = "BGP update group creation failed",
.description = "BGP attempted to create an update group but was unable to", .description = "BGP attempted to create an update group but was unable to",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_UPDATE_SND, .code = EC_BGP_UPDATE_SND,
.title = "BGP error creating update packet", .title = "BGP error creating update packet",
.description = "BGP attempted to create an update packet but was unable to", .description = "BGP attempted to create an update packet but was unable to",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_PKT_OPEN, .code = EC_BGP_PKT_OPEN,
.title = "BGP error receiving open packet", .title = "BGP error receiving open packet",
.description = "BGP received an open from a peer that was invalid", .description = "BGP received an open from a peer that was invalid",
.suggestion = "Determine the sending peer and correct his invalid open packet" .suggestion = "Determine the sending peer and correct his invalid open packet"
}, },
{ {
.code = BGP_ERR_SND_FAIL, .code = EC_BGP_SND_FAIL,
.title = "BGP error sending to peer", .title = "BGP error sending to peer",
.description = "BGP attempted to respond to open from a peer and failed", .description = "BGP attempted to respond to open from a peer and failed",
.suggestion = "BGP attempted to respond to an open and could not sene the packet. Check local IP address for source" .suggestion = "BGP attempted to respond to an open and could not sene the packet. Check local IP address for source"
}, },
{ {
.code = BGP_ERR_INVALID_STATUS, .code = EC_BGP_INVALID_STATUS,
.title = "BGP error receiving from peer", .title = "BGP error receiving from peer",
.description = "BGP received an update from a peer but status was incorrect", .description = "BGP received an update from a peer but status was incorrect",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_UPDATE_RCV, .code = EC_BGP_UPDATE_RCV,
.title = "BGP error receiving update packet", .title = "BGP error receiving update packet",
.description = "BGP received an invalid update packet", .description = "BGP received an invalid update packet",
.suggestion = "Determine the source of the update and resolve the invalid update being sent" .suggestion = "Determine the source of the update and resolve the invalid update being sent"
}, },
{ {
.code = BGP_ERR_NO_CAP, .code = EC_BGP_NO_CAP,
.title = "BGP error due to capability not enabled", .title = "BGP error due to capability not enabled",
.description = "BGP attempted a function that did not have the capability enabled", .description = "BGP attempted a function that did not have the capability enabled",
.suggestion = "Enable the capability if this functionality is desired" .suggestion = "Enable the capability if this functionality is desired"
}, },
{ {
.code = BGP_ERR_NOTIFY_RCV, .code = EC_BGP_NOTIFY_RCV,
.title = "BGP error receiving notify message", .title = "BGP error receiving notify message",
.description = "BGP unable to process notification message", .description = "BGP unable to process notification message",
.suggestion = "BGP notify received while in stopped state. If the problem persists, report for troubleshooting" .suggestion = "BGP notify received while in stopped state. If the problem persists, report for troubleshooting"
}, },
{ {
.code = BGP_ERR_KEEP_RCV, .code = EC_BGP_KEEP_RCV,
.title = "BGP error receiving keepalive packet", .title = "BGP error receiving keepalive packet",
.description = "BGP unable to process keepalive packet", .description = "BGP unable to process keepalive packet",
.suggestion = "BGP keepalive received while in stopped state. If the problem persists, report for troubleshooting" .suggestion = "BGP keepalive received while in stopped state. If the problem persists, report for troubleshooting"
}, },
{ {
.code = BGP_ERR_RFSH_RCV, .code = EC_BGP_RFSH_RCV,
.title = "BGP error receiving route refresh message", .title = "BGP error receiving route refresh message",
.description = "BGP unable to process route refresh message", .description = "BGP unable to process route refresh message",
.suggestion = "BGP route refresh received while in stopped state. If the problem persists, report for troubleshooting"}, .suggestion = "BGP route refresh received while in stopped state. If the problem persists, report for troubleshooting"},
{ {
.code = BGP_ERR_CAP_RCV, .code = EC_BGP_CAP_RCV,
.title = "BGP error capability message", .title = "BGP error capability message",
.description = "BGP unable to process received capability", .description = "BGP unable to process received capability",
.suggestion = "BGP capability message received while in stopped state. If the problem persists, report for troubleshooting" .suggestion = "BGP capability message received while in stopped state. If the problem persists, report for troubleshooting"
}, },
{ {
.code = BGP_ERR_NH_UPD, .code = EC_BGP_NH_UPD,
.title = "BGP error with nexthopo update", .title = "BGP error with nexthopo update",
.description = "BGP unable to process nexthop update", .description = "BGP unable to process nexthop update",
.suggestion = "BGP received nexthop update but nexthop is not reachable in this bgp instance. Report for troubleshooting" .suggestion = "BGP received nexthop update but nexthop is not reachable in this bgp instance. Report for troubleshooting"
}, },
{ {
.code = BGP_ERR_LABEL, .code = EC_BGP_LABEL,
.title = "Failure to apply label", .title = "Failure to apply label",
.description = "BGP attempted to attempted to apply a label but could not", .description = "BGP attempted to attempted to apply a label but could not",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_MULTIPATH, .code = EC_BGP_MULTIPATH,
.title = "Multipath specified is invalid", .title = "Multipath specified is invalid",
.description = "BGP was started with an invalid ecmp/multipath value", .description = "BGP was started with an invalid ecmp/multipath value",
.suggestion = "Correct the ecmp/multipath value supplied when starting the BGP daemon" .suggestion = "Correct the ecmp/multipath value supplied when starting the BGP daemon"
}, },
{ {
.code = BGP_ERR_PKT_PROCESS, .code = EC_BGP_PKT_PROCESS,
.title = "Failure to process a packet", .title = "Failure to process a packet",
.description = "BGP attempted to process a received packet but could not", .description = "BGP attempted to process a received packet but could not",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_CONNECT, .code = EC_BGP_CONNECT,
.title = "Failure to connect to peer", .title = "Failure to connect to peer",
.description = "BGP attempted to send open to peer but couldn't connect", .description = "BGP attempted to send open to peer but couldn't connect",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_FSM, .code = EC_BGP_FSM,
.title = "BGP FSM issue", .title = "BGP FSM issue",
.description = "BGP neighbor transition problem", .description = "BGP neighbor transition problem",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_VNI, .code = EC_BGP_VNI,
.title = "BGP VNI creation issue", .title = "BGP VNI creation issue",
.description = "BGP could not create a new VNI", .description = "BGP could not create a new VNI",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_NO_DFLT, .code = EC_BGP_NO_DFLT,
.title = "BGP default instance missing", .title = "BGP default instance missing",
.description = "BGP could not find default instance", .description = "BGP could not find default instance",
.suggestion = "Define a default instance of BGP since some feature requires it's existence" .suggestion = "Define a default instance of BGP since some feature requires it's existence"
}, },
{ {
.code = BGP_ERR_VTEP_INVALID, .code = EC_BGP_VTEP_INVALID,
.title = "BGP remote VTEP invalid", .title = "BGP remote VTEP invalid",
.description = "BGP remote VTEP is invalid and cannot be used", .description = "BGP remote VTEP is invalid and cannot be used",
.suggestion = "Correct remote VTEP configuration or resolve the source of the problem" .suggestion = "Correct remote VTEP configuration or resolve the source of the problem"
}, },
{ {
.code = BGP_ERR_ES_INVALID, .code = EC_BGP_ES_INVALID,
.title = "BGP ES route error", .title = "BGP ES route error",
.description = "BGP ES route incorrect, learned both local and remote", .description = "BGP ES route incorrect, learned both local and remote",
.suggestion = "Correct configuration or addressing so that same not learned both local and remote" .suggestion = "Correct configuration or addressing so that same not learned both local and remote"
}, },
{ {
.code = BGP_ERR_EVPN_ROUTE_DELETE, .code = EC_BGP_EVPN_ROUTE_DELETE,
.title = "BGP EVPN route delete error", .title = "BGP EVPN route delete error",
.description = "BGP attempted to delete an EVPN route and failed", .description = "BGP attempted to delete an EVPN route and failed",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_EVPN_FAIL, .code = EC_BGP_EVPN_FAIL,
.title = "BGP EVPN install/uninstall error", .title = "BGP EVPN install/uninstall error",
.description = "BGP attempted to install or uninstall an EVPN prefix and failed", .description = "BGP attempted to install or uninstall an EVPN prefix and failed",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_EVPN_ROUTE_INVALID, .code = EC_BGP_EVPN_ROUTE_INVALID,
.title = "BGP EVPN route received with invalid contents", .title = "BGP EVPN route received with invalid contents",
.description = "BGP received an EVPN route with invalid contents", .description = "BGP received an EVPN route with invalid contents",
.suggestion = "Determine the source of the EVPN route and resolve whatever is causing invalid contents" .suggestion = "Determine the source of the EVPN route and resolve whatever is causing invalid contents"
}, },
{ {
.code = BGP_ERR_EVPN_ROUTE_CREATE, .code = EC_BGP_EVPN_ROUTE_CREATE,
.title = "BGP EVPN route create error", .title = "BGP EVPN route create error",
.description = "BGP attempted to create an EVPN route and failed", .description = "BGP attempted to create an EVPN route and failed",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_ES_CREATE, .code = EC_BGP_ES_CREATE,
.title = "BGP EVPN ES entry create error", .title = "BGP EVPN ES entry create error",
.description = "BGP attempted to create an EVPN ES entry and failed", .description = "BGP attempted to create an EVPN ES entry and failed",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
}, },
{ {
.code = BGP_ERR_MULTI_INSTANCE, .code = EC_BGP_MULTI_INSTANCE,
.title = "BGP config multi-instance issue", .title = "BGP config multi-instance issue",
.description = "BGP configuration attempting multiple instances without enabling the feature", .description = "BGP configuration attempting multiple instances without enabling the feature",
.suggestion = "Correct the configuration so that bgp multiple-instance is enabled if desired" .suggestion = "Correct the configuration so that bgp multiple-instance is enabled if desired"
}, },
{ {
.code = BGP_ERR_EVPN_AS_MISMATCH, .code = EC_BGP_EVPN_AS_MISMATCH,
.title = "BGP AS configuration issue", .title = "BGP AS configuration issue",
.description = "BGP configuration attempted for a different AS than currently configured", .description = "BGP configuration attempted for a different AS than currently configured",
.suggestion = "Correct the configuration so that the correct BGP AS number is used" .suggestion = "Correct the configuration so that the correct BGP AS number is used"
}, },
{ {
.code = BGP_ERR_EVPN_INSTANCE_MISMATCH, .code = EC_BGP_EVPN_INSTANCE_MISMATCH,
.title = "BGP EVPN AS and process name mismatch", .title = "BGP EVPN AS and process name mismatch",
.description = "BGP configuration has AS and process name mismatch", .description = "BGP configuration has AS and process name mismatch",
.suggestion = "Correct the configuration so that the BGP AS number and instance name are consistent" .suggestion = "Correct the configuration so that the BGP AS number and instance name are consistent"
}, },
{ {
.code = BGP_ERR_FLOWSPEC_PACKET, .code = EC_BGP_FLOWSPEC_PACKET,
.title = "BGP Flowspec packet processing error", .title = "BGP Flowspec packet processing error",
.description = "The BGP flowspec subsystem has detected a error in the send or receive of a packet", .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" .suggestion = "Gather log files from both sides of the peering relationship and open an issue"
}, },
{ {
.code = BGP_ERR_FLOWSPEC_INSTALLATION, .code = EC_BGP_FLOWSPEC_INSTALLATION,
.title = "BGP Flowspec Installation/removal Error", .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", .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" .suggestion = "Gather log files from the router and open an issue, Restart FRR"

View File

@ -25,80 +25,80 @@
enum bgp_log_refs { enum bgp_log_refs {
BGP_ERR_ATTR_FLAG = BGP_FERR_START, EC_BGP_ATTR_FLAG = BGP_FERR_START,
BGP_ERR_ATTR_LEN, EC_BGP_ATTR_LEN,
BGP_ERR_ATTR_ORIGIN, EC_BGP_ATTR_ORIGIN,
BGP_ERR_ATTR_MAL_AS_PATH, EC_BGP_ATTR_MAL_AS_PATH,
BGP_ERR_ATTR_FIRST_AS, EC_BGP_ATTR_FIRST_AS,
BGP_ERR_ATTR_MARTIAN_NH, EC_BGP_ATTR_MARTIAN_NH,
BGP_ERR_ATTR_PMSI_TYPE, EC_BGP_ATTR_PMSI_TYPE,
BGP_ERR_ATTR_PMSI_LEN, EC_BGP_ATTR_PMSI_LEN,
BGP_ERR_ATTR_NH_SEND_LEN, EC_BGP_ATTR_NH_SEND_LEN,
BGP_ERR_PEER_GROUP, EC_BGP_PEER_GROUP,
BGP_ERR_PEER_DELETE, EC_BGP_PEER_DELETE,
BGP_ERR_TABLE_CHUNK, EC_BGP_TABLE_CHUNK,
BGP_ERR_MACIP_LEN, EC_BGP_MACIP_LEN,
BGP_ERR_LM_ERROR, EC_BGP_LM_ERROR,
BGP_ERR_JSON_MEM_ERROR, EC_BGP_JSON_MEM_ERROR,
BGP_ERR_UPDGRP_ATTR_LEN, EC_BGP_UPDGRP_ATTR_LEN,
BGP_ERR_UPDGRP_CREATE, EC_BGP_UPDGRP_CREATE,
BGP_ERR_UPDATE_SND, EC_BGP_UPDATE_SND,
BGP_ERR_PKT_OPEN, EC_BGP_PKT_OPEN,
BGP_ERR_SND_FAIL, EC_BGP_SND_FAIL,
BGP_ERR_INVALID_STATUS, EC_BGP_INVALID_STATUS,
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
BGP_ERR_NO_CAP, EC_BGP_NO_CAP,
BGP_ERR_NOTIFY_RCV, EC_BGP_NOTIFY_RCV,
BGP_ERR_KEEP_RCV, EC_BGP_KEEP_RCV,
BGP_ERR_RFSH_RCV, EC_BGP_RFSH_RCV,
BGP_ERR_CAP_RCV, EC_BGP_CAP_RCV,
BGP_ERR_NH_UPD, EC_BGP_NH_UPD,
BGP_ERR_LABEL, EC_BGP_LABEL,
BGP_ERR_MULTIPATH, EC_BGP_MULTIPATH,
BGP_ERR_PKT_PROCESS, EC_BGP_PKT_PROCESS,
BGP_ERR_CONNECT, EC_BGP_CONNECT,
BGP_ERR_FSM, EC_BGP_FSM,
BGP_ERR_VNI, EC_BGP_VNI,
BGP_ERR_NO_DFLT, EC_BGP_NO_DFLT,
BGP_ERR_VTEP_INVALID, EC_BGP_VTEP_INVALID,
BGP_ERR_ES_INVALID, EC_BGP_ES_INVALID,
BGP_ERR_EVPN_ROUTE_DELETE, EC_BGP_EVPN_ROUTE_DELETE,
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
BGP_ERR_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_INVALID,
BGP_ERR_EVPN_ROUTE_CREATE, EC_BGP_EVPN_ROUTE_CREATE,
BGP_ERR_ES_CREATE, EC_BGP_ES_CREATE,
BGP_ERR_MULTI_INSTANCE, EC_BGP_MULTI_INSTANCE,
BGP_ERR_EVPN_AS_MISMATCH, EC_BGP_EVPN_AS_MISMATCH,
BGP_ERR_EVPN_INSTANCE_MISMATCH, EC_BGP_EVPN_INSTANCE_MISMATCH,
BGP_ERR_FLOWSPEC_PACKET, EC_BGP_FLOWSPEC_PACKET,
BGP_ERR_FLOWSPEC_INSTALLATION, EC_BGP_FLOWSPEC_INSTALLATION,
BGP_WARN_ASPATH_FEWER_HOPS, EC_BGP_ASPATH_FEWER_HOPS,
BGP_WARN_DEFUNCT_SNPA_LEN, EC_BGP_DEFUNCT_SNPA_LEN,
BGP_WARN_MISSING_ATTRIBUTE, EC_BGP_MISSING_ATTRIBUTE,
BGP_WARN_ATTRIBUTE_TOO_SMALL, EC_BGP_ATTRIBUTE_TOO_SMALL,
BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL, EC_BGP_EXT_ATTRIBUTE_TOO_SMALL,
BGP_WARN_ATTRIBUTE_REPEATED, EC_BGP_ATTRIBUTE_REPEATED,
BGP_WARN_ATTRIBUTE_TOO_LARGE, EC_BGP_ATTRIBUTE_TOO_LARGE,
BGP_WARN_ATTRIBUTE_PARSE_ERROR, EC_BGP_ATTRIBUTE_PARSE_ERROR,
BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW, EC_BGP_ATTRIBUTE_PARSE_WITHDRAW,
BGP_WARN_ATTRIBUTE_FETCH_ERROR, EC_BGP_ATTRIBUTE_FETCH_ERROR,
BGP_WARN_ATTRIBUTES_MISMATCH, EC_BGP_ATTRIBUTES_MISMATCH,
BGP_WARN_DUMP, EC_BGP_DUMP,
BGP_WARN_UPDATE_PACKET_SHORT, EC_BGP_UPDATE_PACKET_SHORT,
BGP_WARN_UPDATE_PACKET_LONG, EC_BGP_UPDATE_PACKET_LONG,
BGP_WARN_UNRECOGNIZED_CAPABILITY, EC_BGP_UNRECOGNIZED_CAPABILITY,
BGP_WARN_NO_TCP_MD5, EC_BGP_NO_TCP_MD5,
BGP_WARN_NO_SOCKOPT_MARK, EC_BGP_NO_SOCKOPT_MARK,
BGP_WARN_EVPN_PMSI_PRESENT, EC_BGP_EVPN_PMSI_PRESENT,
BGP_WARN_EVPN_VPN_VNI, EC_BGP_EVPN_VPN_VNI,
BGP_WARN_EVPN_ESI, EC_BGP_EVPN_ESI,
BGP_WARN_INVALID_LABEL_STACK, EC_BGP_INVALID_LABEL_STACK,
BGP_WARN_ZEBRA_SEND, EC_BGP_ZEBRA_SEND,
BGP_WARN_CAPABILITY_INVALID_LENGTH, EC_BGP_CAPABILITY_INVALID_LENGTH,
BGP_WARN_CAPABILITY_INVALID_DATA, EC_BGP_CAPABILITY_INVALID_DATA,
BGP_WARN_CAPABILITY_VENDOR, EC_BGP_CAPABILITY_VENDOR,
BGP_WARN_CAPABILITY_UNKNOWN, EC_BGP_CAPABILITY_UNKNOWN,
BGP_WARN_INVALID_NEXTHOP_LENGTH, EC_BGP_INVALID_NEXTHOP_LENGTH,
}; };
extern void bgp_error_init(void); extern void bgp_error_init(void);

View File

@ -173,7 +173,7 @@ static struct vrf_irt_node *vrf_import_rt_new(struct ecommunity_val *rt)
bgp_def = bgp_get_default(); bgp_def = bgp_get_default();
if (!bgp_def) { if (!bgp_def) {
flog_err(BGP_ERR_NO_DFLT, flog_err(EC_BGP_NO_DFLT,
"vrf import rt new - def instance not created yet"); "vrf import rt new - def instance not created yet");
return NULL; return NULL;
} }
@ -204,7 +204,7 @@ static void vrf_import_rt_free(struct vrf_irt_node *irt)
bgp_def = bgp_get_default(); bgp_def = bgp_get_default();
if (!bgp_def) { if (!bgp_def) {
flog_err(BGP_ERR_NO_DFLT, flog_err(EC_BGP_NO_DFLT,
"vrf import rt free - def instance not created yet"); "vrf import rt free - def instance not created yet");
return; return;
} }
@ -227,7 +227,7 @@ static struct vrf_irt_node *lookup_vrf_import_rt(struct ecommunity_val *rt)
bgp_def = bgp_get_default(); bgp_def = bgp_get_default();
if (!bgp_def) { if (!bgp_def) {
flog_err( flog_err(
BGP_ERR_NO_DFLT, EC_BGP_NO_DFLT,
"vrf import rt lookup - def instance not created yet"); "vrf import rt lookup - def instance not created yet");
return NULL; return NULL;
} }
@ -628,7 +628,7 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
stream_put_in_addr(s, &p->prefix.imet_addr.ip.ipaddr_v4); stream_put_in_addr(s, &p->prefix.imet_addr.ip.ipaddr_v4);
else if (is_evpn_prefix_ipaddr_v6(p)) { else if (is_evpn_prefix_ipaddr_v6(p)) {
flog_err( flog_err(
BGP_ERR_VTEP_INVALID, EC_BGP_VTEP_INVALID,
"Bad remote IP when trying to %s remote VTEP for VNI %u", "Bad remote IP when trying to %s remote VTEP for VNI %u",
add ? "ADD" : "DEL", vpn->vni); add ? "ADD" : "DEL", vpn->vni);
return -1; return -1;
@ -1302,7 +1302,7 @@ static int update_evpn_type4_route_entry(struct bgp *bgp,
*/ */
if (remote_ri) { if (remote_ri) {
flog_err( flog_err(
BGP_ERR_ES_INVALID, EC_BGP_ES_INVALID,
"%u ERROR: local es route for ESI: %s Vtep %s also learnt from remote", "%u ERROR: local es route for ESI: %s Vtep %s also learnt from remote",
bgp->vrf_id, bgp->vrf_id,
esi_to_str(&evp->prefix.es_addr.esi, buf, sizeof(buf)), esi_to_str(&evp->prefix.es_addr.esi, buf, sizeof(buf)),
@ -1390,7 +1390,7 @@ static int update_evpn_type4_route(struct bgp *bgp,
&route_changed); &route_changed);
if (ret != 0) { if (ret != 0) {
flog_err( flog_err(
BGP_ERR_ES_INVALID, EC_BGP_ES_INVALID,
"%u ERROR: Failed to updated ES route ESI: %s VTEP %s", "%u ERROR: Failed to updated ES route ESI: %s VTEP %s",
bgp->vrf_id, bgp->vrf_id,
esi_to_str(&p->prefix.es_addr.esi, buf, sizeof(buf)), esi_to_str(&p->prefix.es_addr.esi, buf, sizeof(buf)),
@ -2191,7 +2191,7 @@ static int delete_routes_for_es(struct bgp *bgp, struct evpnes *es)
build_evpn_type4_prefix(&p, &es->esi, es->originator_ip.ipaddr_v4); build_evpn_type4_prefix(&p, &es->esi, es->originator_ip.ipaddr_v4);
ret = delete_evpn_type4_route(bgp, es, &p); ret = delete_evpn_type4_route(bgp, es, &p);
if (ret) { if (ret) {
flog_err(BGP_ERR_EVPN_ROUTE_DELETE, flog_err(EC_BGP_EVPN_ROUTE_DELETE,
"%u failed to delete type-4 route for ESI %s", "%u failed to delete type-4 route for ESI %s",
bgp->vrf_id, esi_to_str(&es->esi, buf, sizeof(buf))); bgp->vrf_id, esi_to_str(&es->esi, buf, sizeof(buf)));
} }
@ -2851,7 +2851,7 @@ static int install_uninstall_routes_for_es(struct bgp *bgp,
if (ret) { if (ret) {
flog_err( flog_err(
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
"Failed to %s EVPN %s route in ESI %s", "Failed to %s EVPN %s route in ESI %s",
install ? "install" install ? "install"
: "uninstall", : "uninstall",
@ -2931,7 +2931,7 @@ static int install_uninstall_routes_for_vrf(struct bgp *bgp_vrf, int install)
if (ret) { if (ret) {
flog_err( flog_err(
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
"Failed to %s EVPN %s route in VRF %s", "Failed to %s EVPN %s route in VRF %s",
install ? "install" install ? "install"
: "uninstall", : "uninstall",
@ -3005,7 +3005,7 @@ static int install_uninstall_routes_for_vni(struct bgp *bgp,
if (ret) { if (ret) {
flog_err( flog_err(
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
"%u: Failed to %s EVPN %s route in VNI %u", "%u: Failed to %s EVPN %s route in VNI %u",
bgp->vrf_id, bgp->vrf_id,
install ? "install" install ? "install"
@ -3108,7 +3108,7 @@ static int install_uninstall_route_in_es(struct bgp *bgp, struct evpnes *es,
if (ret) { if (ret) {
flog_err( flog_err(
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
"%u: Failed to %s EVPN %s route in ESI %s", bgp->vrf_id, "%u: Failed to %s EVPN %s route in ESI %s", bgp->vrf_id,
install ? "install" : "uninstall", "ES", install ? "install" : "uninstall", "ES",
esi_to_str(&evp->prefix.es_addr.esi, buf, sizeof(buf))); esi_to_str(&evp->prefix.es_addr.esi, buf, sizeof(buf)));
@ -3150,7 +3150,7 @@ static int install_uninstall_route_in_vrfs(struct bgp *bgp_def, afi_t afi,
ri); ri);
if (ret) { if (ret) {
flog_err(BGP_ERR_EVPN_FAIL, flog_err(EC_BGP_EVPN_FAIL,
"%u: Failed to %s prefix %s in VRF %s", "%u: Failed to %s prefix %s in VRF %s",
bgp_def->vrf_id, bgp_def->vrf_id,
install ? "install" : "uninstall", install ? "install" : "uninstall",
@ -3187,7 +3187,7 @@ static int install_uninstall_route_in_vnis(struct bgp *bgp, afi_t afi,
if (ret) { if (ret) {
flog_err( flog_err(
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
"%u: Failed to %s EVPN %s route in VNI %u", "%u: Failed to %s EVPN %s route in VNI %u",
bgp->vrf_id, install ? "install" : "uninstall", bgp->vrf_id, install ? "install" : "uninstall",
evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE
@ -3559,7 +3559,7 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
*/ */
if (psize != 33 && psize != 37 && psize != 49 && psize != 36 if (psize != 33 && psize != 37 && psize != 49 && psize != 36
&& psize != 40 && psize != 52) { && psize != 40 && psize != 52) {
flog_err(BGP_ERR_EVPN_ROUTE_INVALID, flog_err(EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-2 NLRI with invalid length %d", "%u:%s - Rx EVPN Type-2 NLRI with invalid length %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -3597,7 +3597,7 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
pfx += ETH_ALEN; pfx += ETH_ALEN;
} else { } else {
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-2 NLRI with unsupported MAC address length %d", "%u:%s - Rx EVPN Type-2 NLRI with unsupported MAC address length %d",
peer->bgp->vrf_id, peer->host, macaddr_len); peer->bgp->vrf_id, peer->host, macaddr_len);
return -1; return -1;
@ -3609,7 +3609,7 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
if (ipaddr_len != 0 && ipaddr_len != IPV4_MAX_BITLEN if (ipaddr_len != 0 && ipaddr_len != IPV4_MAX_BITLEN
&& ipaddr_len != IPV6_MAX_BITLEN) { && ipaddr_len != IPV6_MAX_BITLEN) {
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-2 NLRI with unsupported IP address length %d", "%u:%s - Rx EVPN Type-2 NLRI with unsupported IP address length %d",
peer->bgp->vrf_id, peer->host, ipaddr_len); peer->bgp->vrf_id, peer->host, ipaddr_len);
return -1; return -1;
@ -3670,7 +3670,7 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
* IP len (1) and IP (4 or 16). * IP len (1) and IP (4 or 16).
*/ */
if (psize != 17 && psize != 29) { if (psize != 17 && psize != 29) {
flog_err(BGP_ERR_EVPN_ROUTE_INVALID, flog_err(EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-3 NLRI with invalid length %d", "%u:%s - Rx EVPN Type-3 NLRI with invalid length %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -3684,7 +3684,7 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) { (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) {
if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) { if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) {
flog_warn( flog_warn(
BGP_WARN_EVPN_PMSI_PRESENT, EC_BGP_EVPN_PMSI_PRESENT,
"%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
peer->bgp->vrf_id, peer->host, peer->bgp->vrf_id, peer->host,
attr->pmsi_tnl_type); attr->pmsi_tnl_type);
@ -3715,7 +3715,7 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
memcpy(&p.prefix.imet_addr.ip.ip.addr, pfx, IPV4_MAX_BYTELEN); memcpy(&p.prefix.imet_addr.ip.ip.addr, pfx, IPV4_MAX_BYTELEN);
} else { } else {
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-3 NLRI with unsupported IP address length %d", "%u:%s - Rx EVPN Type-3 NLRI with unsupported IP address length %d",
peer->bgp->vrf_id, peer->host, ipaddr_len); peer->bgp->vrf_id, peer->host, ipaddr_len);
return -1; return -1;
@ -3751,7 +3751,7 @@ static int process_type4_route(struct peer *peer, afi_t afi, safi_t safi,
* RD (8), ESI (10), ip-len (1), ip (4 or 16) * RD (8), ESI (10), ip-len (1), ip (4 or 16)
*/ */
if (psize != 23 && psize != 35) { if (psize != 23 && psize != 35) {
flog_err(BGP_ERR_EVPN_ROUTE_INVALID, flog_err(EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-4 NLRI with invalid length %d", "%u:%s - Rx EVPN Type-4 NLRI with invalid length %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -3774,7 +3774,7 @@ static int process_type4_route(struct peer *peer, afi_t afi, safi_t safi,
memcpy(&vtep_ip, pfx, IPV4_MAX_BYTELEN); memcpy(&vtep_ip, pfx, IPV4_MAX_BYTELEN);
} else { } else {
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-4 NLRI with unsupported IP address length %d", "%u:%s - Rx EVPN Type-4 NLRI with unsupported IP address length %d",
peer->bgp->vrf_id, peer->host, ipaddr_len); peer->bgp->vrf_id, peer->host, ipaddr_len);
return -1; return -1;
@ -3816,7 +3816,7 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
* Note that the IP and GW should both be IPv4 or both IPv6. * Note that the IP and GW should both be IPv4 or both IPv6.
*/ */
if (psize != 34 && psize != 58) { if (psize != 34 && psize != 58) {
flog_err(BGP_ERR_EVPN_ROUTE_INVALID, flog_err(EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-5 NLRI with invalid length %d", "%u:%s - Rx EVPN Type-5 NLRI with invalid length %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -3850,7 +3850,7 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
ippfx_len = *pfx++; ippfx_len = *pfx++;
if (ippfx_len > IPV6_MAX_BITLEN) { if (ippfx_len > IPV6_MAX_BITLEN) {
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_INVALID,
"%u:%s - Rx EVPN Type-5 NLRI with invalid IP Prefix length %d", "%u:%s - Rx EVPN Type-5 NLRI with invalid IP Prefix length %d",
peer->bgp->vrf_id, peer->host, ippfx_len); peer->bgp->vrf_id, peer->host, ippfx_len);
return -1; return -1;
@ -4077,7 +4077,7 @@ void bgp_evpn_withdraw_type5_route(struct bgp *bgp_vrf, struct prefix *p,
ret = delete_evpn_type5_route(bgp_vrf, &evp); ret = delete_evpn_type5_route(bgp_vrf, &evp);
if (ret) { if (ret) {
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_DELETE, EC_BGP_EVPN_ROUTE_DELETE,
"%u failed to delete type-5 route for prefix %s in vrf %s", "%u failed to delete type-5 route for prefix %s in vrf %s",
bgp_vrf->vrf_id, prefix2str(p, buf, sizeof(buf)), bgp_vrf->vrf_id, prefix2str(p, buf, sizeof(buf)),
vrf_id_to_name(bgp_vrf->vrf_id)); vrf_id_to_name(bgp_vrf->vrf_id));
@ -4123,7 +4123,7 @@ void bgp_evpn_advertise_type5_route(struct bgp *bgp_vrf, struct prefix *p,
build_type5_prefix_from_ip_prefix(&evp, p); build_type5_prefix_from_ip_prefix(&evp, p);
ret = update_evpn_type5_route(bgp_vrf, &evp, src_attr); ret = update_evpn_type5_route(bgp_vrf, &evp, src_attr);
if (ret) if (ret)
flog_err(BGP_ERR_EVPN_ROUTE_CREATE, flog_err(EC_BGP_EVPN_ROUTE_CREATE,
"%u: Failed to create type-5 route for prefix %s", "%u: Failed to create type-5 route for prefix %s",
bgp_vrf->vrf_id, prefix2str(p, buf, sizeof(buf))); bgp_vrf->vrf_id, prefix2str(p, buf, sizeof(buf)));
} }
@ -4684,7 +4684,7 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
withdraw ? NULL : attr, pnt, withdraw ? NULL : attr, pnt,
psize, addpath_id)) { psize, addpath_id)) {
flog_err( flog_err(
BGP_ERR_EVPN_FAIL, EC_BGP_EVPN_FAIL,
"%u:%s - Error in processing EVPN type-2 NLRI size %d", "%u:%s - Error in processing EVPN type-2 NLRI size %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -4696,7 +4696,7 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
withdraw ? NULL : attr, pnt, withdraw ? NULL : attr, pnt,
psize, addpath_id)) { psize, addpath_id)) {
flog_err( flog_err(
BGP_ERR_PKT_PROCESS, EC_BGP_PKT_PROCESS,
"%u:%s - Error in processing EVPN type-3 NLRI size %d", "%u:%s - Error in processing EVPN type-3 NLRI size %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -4708,7 +4708,7 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
withdraw ? NULL : attr, pnt, withdraw ? NULL : attr, pnt,
psize, addpath_id)) { psize, addpath_id)) {
flog_err( flog_err(
BGP_ERR_PKT_PROCESS, EC_BGP_PKT_PROCESS,
"%u:%s - Error in processing EVPN type-4 NLRI size %d", "%u:%s - Error in processing EVPN type-4 NLRI size %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -4719,7 +4719,7 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
if (process_type5_route(peer, afi, safi, attr, pnt, if (process_type5_route(peer, afi, safi, attr, pnt,
psize, addpath_id, withdraw)) { psize, addpath_id, withdraw)) {
flog_err( flog_err(
BGP_ERR_PKT_PROCESS, EC_BGP_PKT_PROCESS,
"%u:%s - Error in processing EVPN type-5 NLRI size %d", "%u:%s - Error in processing EVPN type-5 NLRI size %d",
peer->bgp->vrf_id, peer->host, psize); peer->bgp->vrf_id, peer->host, psize);
return -1; return -1;
@ -5164,7 +5164,7 @@ int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
/* Lookup VNI hash - should exist. */ /* Lookup VNI hash - should exist. */
vpn = bgp_evpn_lookup_vni(bgp, vni); vpn = bgp_evpn_lookup_vni(bgp, vni);
if (!vpn || !is_vni_live(vpn)) { if (!vpn || !is_vni_live(vpn)) {
flog_warn(BGP_WARN_EVPN_VPN_VNI, flog_warn(EC_BGP_EVPN_VPN_VNI,
"%u: VNI hash entry for VNI %u %s at MACIP DEL", "%u: VNI hash entry for VNI %u %s at MACIP DEL",
bgp->vrf_id, vni, vpn ? "not live" : "not found"); bgp->vrf_id, vni, vpn ? "not live" : "not found");
return -1; return -1;
@ -5189,7 +5189,7 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
/* Lookup VNI hash - should exist. */ /* Lookup VNI hash - should exist. */
vpn = bgp_evpn_lookup_vni(bgp, vni); vpn = bgp_evpn_lookup_vni(bgp, vni);
if (!vpn || !is_vni_live(vpn)) { if (!vpn || !is_vni_live(vpn)) {
flog_warn(BGP_WARN_EVPN_VPN_VNI, flog_warn(EC_BGP_EVPN_VPN_VNI,
"%u: VNI hash entry for VNI %u %s at MACIP ADD", "%u: VNI hash entry for VNI %u %s at MACIP ADD",
bgp->vrf_id, vni, vpn ? "not live" : "not found"); bgp->vrf_id, vni, vpn ? "not live" : "not found");
return -1; return -1;
@ -5202,7 +5202,7 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
char buf2[INET6_ADDRSTRLEN]; char buf2[INET6_ADDRSTRLEN];
flog_err( flog_err(
BGP_ERR_EVPN_ROUTE_CREATE, EC_BGP_EVPN_ROUTE_CREATE,
"%u:Failed to create Type-2 route, VNI %u %s MAC %s IP %s (flags: 0x%x)", "%u:Failed to create Type-2 route, VNI %u %s MAC %s IP %s (flags: 0x%x)",
bgp->vrf_id, vpn->vni, bgp->vrf_id, vpn->vni,
CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY) CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY)
@ -5244,7 +5244,7 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id, struct ethaddr *rmac,
bgp_def = bgp_get_default(); bgp_def = bgp_get_default();
if (!bgp_def) { if (!bgp_def) {
flog_err( flog_err(
BGP_ERR_NO_DFLT, EC_BGP_NO_DFLT,
"Cannot process L3VNI %u ADD - default BGP instance not yet created", "Cannot process L3VNI %u ADD - default BGP instance not yet created",
l3vni); l3vni);
return -1; return -1;
@ -5261,15 +5261,15 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id, struct ethaddr *rmac,
BGP_INSTANCE_TYPE_VRF); BGP_INSTANCE_TYPE_VRF);
switch (ret) { switch (ret) {
case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET:
flog_err(BGP_ERR_MULTI_INSTANCE, flog_err(EC_BGP_MULTI_INSTANCE,
"'bgp multiple-instance' not present\n"); "'bgp multiple-instance' not present\n");
return -1; return -1;
case BGP_ERR_AS_MISMATCH: case BGP_ERR_AS_MISMATCH:
flog_err(BGP_ERR_EVPN_AS_MISMATCH, flog_err(EC_BGP_EVPN_AS_MISMATCH,
"BGP is already running; AS is %u\n", as); "BGP is already running; AS is %u\n", as);
return -1; return -1;
case BGP_ERR_INSTANCE_MISMATCH: case BGP_ERR_INSTANCE_MISMATCH:
flog_err(BGP_ERR_EVPN_INSTANCE_MISMATCH, flog_err(EC_BGP_EVPN_INSTANCE_MISMATCH,
"BGP instance name and AS number mismatch\n"); "BGP instance name and AS number mismatch\n");
return -1; return -1;
} }
@ -5332,7 +5332,7 @@ int bgp_evpn_local_l3vni_del(vni_t l3vni, vrf_id_t vrf_id)
bgp_vrf = bgp_lookup_by_vrf_id(vrf_id); bgp_vrf = bgp_lookup_by_vrf_id(vrf_id);
if (!bgp_vrf) { if (!bgp_vrf) {
flog_err( flog_err(
BGP_ERR_NO_DFLT, EC_BGP_NO_DFLT,
"Cannot process L3VNI %u Del - Could not find BGP instance", "Cannot process L3VNI %u Del - Could not find BGP instance",
l3vni); l3vni);
return -1; return -1;
@ -5341,7 +5341,7 @@ int bgp_evpn_local_l3vni_del(vni_t l3vni, vrf_id_t vrf_id)
bgp_def = bgp_get_default(); bgp_def = bgp_get_default();
if (!bgp_def) { if (!bgp_def) {
flog_err( flog_err(
BGP_ERR_NO_DFLT, EC_BGP_NO_DFLT,
"Cannot process L3VNI %u Del - Could not find default BGP instance", "Cannot process L3VNI %u Del - Could not find default BGP instance",
l3vni); l3vni);
return -1; return -1;
@ -5403,7 +5403,7 @@ int bgp_evpn_local_vni_del(struct bgp *bgp, vni_t vni)
if (!vpn) { if (!vpn) {
if (bgp_debug_zebra(NULL)) if (bgp_debug_zebra(NULL))
flog_warn( flog_warn(
BGP_WARN_EVPN_VPN_VNI, EC_BGP_EVPN_VPN_VNI,
"%u: VNI hash entry for VNI %u not found at DEL", "%u: VNI hash entry for VNI %u not found at DEL",
bgp->vrf_id, vni); bgp->vrf_id, vni);
return 0; return 0;
@ -5473,7 +5473,7 @@ int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
vpn = bgp_evpn_new(bgp, vni, originator_ip, tenant_vrf_id); vpn = bgp_evpn_new(bgp, vni, originator_ip, tenant_vrf_id);
if (!vpn) { if (!vpn) {
flog_err( flog_err(
BGP_ERR_VNI, EC_BGP_VNI,
"%u: Failed to allocate VNI entry for VNI %u - at Add", "%u: Failed to allocate VNI entry for VNI %u - at Add",
bgp->vrf_id, vni); bgp->vrf_id, vni);
return -1; return -1;
@ -5496,7 +5496,7 @@ int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
/* Create EVPN type-3 route and schedule for processing. */ /* Create EVPN type-3 route and schedule for processing. */
build_evpn_type3_prefix(&p, vpn->originator_ip); build_evpn_type3_prefix(&p, vpn->originator_ip);
if (update_evpn_route(bgp, vpn, &p, 0, 0)) { if (update_evpn_route(bgp, vpn, &p, 0, 0)) {
flog_err(BGP_ERR_EVPN_ROUTE_CREATE, flog_err(EC_BGP_EVPN_ROUTE_CREATE,
"%u: Type3 route creation failure for VNI %u", "%u: Type3 route creation failure for VNI %u",
bgp->vrf_id, vni); bgp->vrf_id, vni);
return -1; return -1;
@ -5526,7 +5526,7 @@ int bgp_evpn_local_es_del(struct bgp *bgp,
struct evpnes *es = NULL; struct evpnes *es = NULL;
if (!bgp->esihash) { if (!bgp->esihash) {
flog_err(BGP_ERR_ES_CREATE, "%u: ESI hash not yet created", flog_err(EC_BGP_ES_CREATE, "%u: ESI hash not yet created",
bgp->vrf_id); bgp->vrf_id);
return -1; return -1;
} }
@ -5534,7 +5534,7 @@ int bgp_evpn_local_es_del(struct bgp *bgp,
/* Lookup ESI hash - should exist. */ /* Lookup ESI hash - should exist. */
es = bgp_evpn_lookup_es(bgp, esi); es = bgp_evpn_lookup_es(bgp, esi);
if (!es) { if (!es) {
flog_warn(BGP_WARN_EVPN_ESI, flog_warn(EC_BGP_EVPN_ESI,
"%u: ESI hash entry for ESI %s at Local ES DEL", "%u: ESI hash entry for ESI %s at Local ES DEL",
bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf))); bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf)));
return -1; return -1;
@ -5563,7 +5563,7 @@ int bgp_evpn_local_es_add(struct bgp *bgp,
struct prefix_evpn p; struct prefix_evpn p;
if (!bgp->esihash) { if (!bgp->esihash) {
flog_err(BGP_ERR_ES_CREATE, "%u: ESI hash not yet created", flog_err(EC_BGP_ES_CREATE, "%u: ESI hash not yet created",
bgp->vrf_id); bgp->vrf_id);
return -1; return -1;
} }
@ -5574,7 +5574,7 @@ int bgp_evpn_local_es_add(struct bgp *bgp,
es = bgp_evpn_es_new(bgp, esi, originator_ip); es = bgp_evpn_es_new(bgp, esi, originator_ip);
if (!es) { if (!es) {
flog_err( flog_err(
BGP_ERR_ES_CREATE, EC_BGP_ES_CREATE,
"%u: Failed to allocate ES entry for ESI %s - at Local ES Add", "%u: Failed to allocate ES entry for ESI %s - at Local ES Add",
bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf))); bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf)));
return -1; return -1;
@ -5585,7 +5585,7 @@ int bgp_evpn_local_es_add(struct bgp *bgp,
build_evpn_type4_prefix(&p, esi, originator_ip->ipaddr_v4); build_evpn_type4_prefix(&p, esi, originator_ip->ipaddr_v4);
if (update_evpn_type4_route(bgp, es, &p)) { if (update_evpn_type4_route(bgp, es, &p)) {
flog_err(BGP_ERR_EVPN_ROUTE_CREATE, flog_err(EC_BGP_EVPN_ROUTE_CREATE,
"%u: Type4 route creation failure for ESI %s", "%u: Type4 route creation failure for ESI %s",
bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf))); bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf)));
return -1; return -1;

View File

@ -1890,7 +1890,7 @@ static struct bgpevpn *evpn_create_update_vni(struct bgp *bgp, vni_t vni)
if (!vpn) { if (!vpn) {
/* Check if this L2VNI is already configured as L3VNI */ /* Check if this L2VNI is already configured as L3VNI */
if (bgp_evpn_lookup_l3vni_l2vni_table(vni)) { if (bgp_evpn_lookup_l3vni_l2vni_table(vni)) {
flog_err(BGP_ERR_VNI, flog_err(EC_BGP_VNI,
"%u: Failed to create L2VNI %u, it is configured as L3VNI", "%u: Failed to create L2VNI %u, it is configured as L3VNI",
bgp->vrf_id, vni); bgp->vrf_id, vni);
return NULL; return NULL;
@ -1902,7 +1902,7 @@ static struct bgpevpn *evpn_create_update_vni(struct bgp *bgp, vni_t vni)
vpn = bgp_evpn_new(bgp, vni, bgp->router_id, 0); vpn = bgp_evpn_new(bgp, vni, bgp->router_id, 0);
if (!vpn) { if (!vpn) {
flog_err( flog_err(
BGP_ERR_VNI, EC_BGP_VNI,
"%u: Failed to allocate VNI entry for VNI %u - at Config", "%u: Failed to allocate VNI entry for VNI %u - at Config",
bgp->vrf_id, vni); bgp->vrf_id, vni);
return NULL; return NULL;

View File

@ -110,7 +110,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
} }
if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT) { if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT) {
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"BGP flowspec nlri length maximum reached (%u)", "BGP flowspec nlri length maximum reached (%u)",
packet->length); packet->length);
return -1; return -1;
@ -128,13 +128,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
/* When packet overflow occur return immediately. */ /* When packet overflow occur return immediately. */
if (pnt + psize > lim) { if (pnt + psize > lim) {
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"Flowspec NLRI length inconsistent ( size %u seen)", "Flowspec NLRI length inconsistent ( size %u seen)",
psize); psize);
return -1; return -1;
} }
if (bgp_fs_nlri_validate(pnt, psize) < 0) { if (bgp_fs_nlri_validate(pnt, psize) < 0) {
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"Bad flowspec format or NLRI options not supported"); "Bad flowspec format or NLRI options not supported");
return -1; return -1;
} }
@ -188,7 +188,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
NULL, NULL, 0, NULL); NULL, NULL, 0, NULL);
if (ret) { if (ret) {
flog_err(BGP_ERR_FLOWSPEC_INSTALLATION, flog_err(EC_BGP_FLOWSPEC_INSTALLATION,
"Flowspec NLRI failed to be %s.", "Flowspec NLRI failed to be %s.",
attr ? "added" : "withdrawn"); attr ? "added" : "withdrawn");
return -1; return -1;

View File

@ -68,7 +68,7 @@ static int bgp_flowspec_call_non_opaque_decode(uint8_t *nlri_content, int len,
len, len,
mval, error); mval, error);
if (*error < 0) if (*error < 0)
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"%s: flowspec_op_decode error %d", "%s: flowspec_op_decode error %d",
__func__, *error); __func__, *error);
else else
@ -447,7 +447,7 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
len - offset, len - offset,
prefix, &error); prefix, &error);
if (error < 0) if (error < 0)
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"%s: flowspec_ip_address error %d", "%s: flowspec_ip_address error %d",
__func__, error); __func__, error);
else else
@ -542,7 +542,7 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
len - offset, len - offset,
&bpem->tcpflags, &error); &bpem->tcpflags, &error);
if (error < 0) if (error < 0)
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"%s: flowspec_tcpflags_decode error %d", "%s: flowspec_tcpflags_decode error %d",
__func__, error); __func__, error);
else else
@ -557,7 +557,7 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
len - offset, &bpem->fragment, len - offset, &bpem->fragment,
&error); &error);
if (error < 0) if (error < 0)
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"%s: flowspec_fragment_type_decode error %d", "%s: flowspec_fragment_type_decode error %d",
__func__, error); __func__, error);
else else

View File

@ -167,7 +167,7 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
*/ */
if (peer->curr) { if (peer->curr) {
flog_err( flog_err(
BGP_ERR_PKT_PROCESS, EC_BGP_PKT_PROCESS,
"[%s] Dropping pending packet on connection transfer:", "[%s] Dropping pending packet on connection transfer:",
peer->host); peer->host);
uint16_t type = stream_getc_from(peer->curr, uint16_t type = stream_getc_from(peer->curr,
@ -1286,7 +1286,7 @@ static int bgp_connect_check(struct thread *thread)
static int bgp_connect_success(struct peer *peer) static int bgp_connect_success(struct peer *peer)
{ {
if (peer->fd < 0) { if (peer->fd < 0) {
flog_err(BGP_ERR_CONNECT, flog_err(EC_BGP_CONNECT,
"bgp_connect_success peer's fd is negative value %d", "bgp_connect_success peer's fd is negative value %d",
peer->fd); peer->fd);
bgp_stop(peer); bgp_stop(peer);
@ -1354,7 +1354,7 @@ int bgp_start(struct peer *peer)
if (BGP_PEER_START_SUPPRESSED(peer)) { if (BGP_PEER_START_SUPPRESSED(peer)) {
if (bgp_debug_neighbor_events(peer)) if (bgp_debug_neighbor_events(peer))
flog_err(BGP_ERR_FSM, flog_err(EC_BGP_FSM,
"%s [FSM] Trying to start suppressed peer" "%s [FSM] Trying to start suppressed peer"
" - this is never supposed to happen!", " - this is never supposed to happen!",
peer->host); peer->host);
@ -1390,7 +1390,7 @@ int bgp_start(struct peer *peer)
if (peer->bgp->vrf_id == VRF_UNKNOWN) { if (peer->bgp->vrf_id == VRF_UNKNOWN) {
if (bgp_debug_neighbor_events(peer)) if (bgp_debug_neighbor_events(peer))
flog_err( flog_err(
BGP_ERR_FSM, EC_BGP_FSM,
"%s [FSM] In a VRF that is not initialised yet", "%s [FSM] In a VRF that is not initialised yet",
peer->host); peer->host);
return -1; return -1;
@ -1444,7 +1444,7 @@ int bgp_start(struct peer *peer)
"%s [FSM] Non blocking connect waiting result, fd %d", "%s [FSM] Non blocking connect waiting result, fd %d",
peer->host, peer->fd); peer->host, peer->fd);
if (peer->fd < 0) { if (peer->fd < 0) {
flog_err(BGP_ERR_FSM, flog_err(EC_BGP_FSM,
"bgp_start peer's fd is negative value %d", "bgp_start peer's fd is negative value %d",
peer->fd); peer->fd);
return -1; return -1;
@ -1492,7 +1492,7 @@ static int bgp_fsm_open(struct peer *peer)
peer and change to Idle status. */ peer and change to Idle status. */
static int bgp_fsm_event_error(struct peer *peer) static int bgp_fsm_event_error(struct peer *peer)
{ {
flog_err(BGP_ERR_FSM, flog_err(EC_BGP_FSM,
"%s [FSM] unexpected packet received in state %s", peer->host, "%s [FSM] unexpected packet received in state %s", peer->host,
lookup_msg(bgp_status_msg, peer->status, NULL)); lookup_msg(bgp_status_msg, peer->status, NULL));
@ -1526,7 +1526,7 @@ static int bgp_establish(struct peer *peer)
other = peer->doppelganger; other = peer->doppelganger;
peer = peer_xfer_conn(peer); peer = peer_xfer_conn(peer);
if (!peer) { if (!peer) {
flog_err(BGP_ERR_CONNECT, "%%Neighbor failed in xfer_conn"); flog_err(EC_BGP_CONNECT, "%%Neighbor failed in xfer_conn");
return -1; return -1;
} }
@ -1686,7 +1686,7 @@ static int bgp_fsm_update(struct peer *peer)
static int bgp_ignore(struct peer *peer) static int bgp_ignore(struct peer *peer)
{ {
flog_err( flog_err(
BGP_ERR_FSM, EC_BGP_FSM,
"%s [FSM] Ignoring event %s in state %s, prior events %s, %s, fd %d", "%s [FSM] Ignoring event %s in state %s, prior events %s, %s, fd %d",
peer->host, bgp_event_str[peer->cur_event], peer->host, bgp_event_str[peer->cur_event],
lookup_msg(bgp_status_msg, peer->status, NULL), lookup_msg(bgp_status_msg, peer->status, NULL),
@ -1699,7 +1699,7 @@ static int bgp_ignore(struct peer *peer)
static int bgp_fsm_exeption(struct peer *peer) static int bgp_fsm_exeption(struct peer *peer)
{ {
flog_err( flog_err(
BGP_ERR_FSM, EC_BGP_FSM,
"%s [FSM] Unexpected event %s in state %s, prior events %s, %s, fd %d", "%s [FSM] Unexpected event %s in state %s, prior events %s, %s, fd %d",
peer->host, bgp_event_str[peer->cur_event], peer->host, bgp_event_str[peer->cur_event],
lookup_msg(bgp_status_msg, peer->status, NULL), lookup_msg(bgp_status_msg, peer->status, NULL),
@ -1974,7 +1974,7 @@ int bgp_event_update(struct peer *peer, int event)
*/ */
if (!dyn_nbr && !passive_conn && peer->bgp) { if (!dyn_nbr && !passive_conn && peer->bgp) {
flog_err( flog_err(
BGP_ERR_FSM, EC_BGP_FSM,
"%s [FSM] Failure handling event %s in state %s, " "%s [FSM] Failure handling event %s in state %s, "
"prior events %s, %s, fd %d", "prior events %s, %s, fd %d",
peer->host, bgp_event_str[peer->cur_event], peer->host, bgp_event_str[peer->cur_event],

View File

@ -402,7 +402,7 @@ static uint16_t bgp_read(struct peer *peer)
SET_FLAG(status, BGP_IO_TRANS_ERR); SET_FLAG(status, BGP_IO_TRANS_ERR);
/* Fatal error; tear down session */ /* Fatal error; tear down session */
} else if (nbytes < 0) { } else if (nbytes < 0) {
flog_err(BGP_ERR_UPDATE_RCV, flog_err(EC_BGP_UPDATE_RCV,
"%s [Error] bgp_read_packet error: %s", peer->host, "%s [Error] bgp_read_packet error: %s", peer->host,
safe_strerror(errno)); safe_strerror(errno));

View File

@ -192,7 +192,7 @@ static int bgp_nlri_get_labels(struct peer *peer, uint8_t *pnt, uint8_t plen,
if (!(bgp_is_withdraw_label(label) || label_bos(label))) if (!(bgp_is_withdraw_label(label) || label_bos(label)))
flog_warn( flog_warn(
BGP_WARN_INVALID_LABEL_STACK, EC_BGP_INVALID_LABEL_STACK,
"%s rcvd UPDATE with invalid label stack - no bottom of stack", "%s rcvd UPDATE with invalid label stack - no bottom of stack",
peer->host); peer->host);
@ -247,7 +247,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
/* sanity check against packet data */ /* sanity check against packet data */
if ((pnt + psize) > lim) { if ((pnt + psize) > lim) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / L-U (prefix length %d exceeds packet size %u)", "%s [Error] Update packet error / L-U (prefix length %d exceeds packet size %u)",
peer->host, prefixlen, (uint)(lim - pnt)); peer->host, prefixlen, (uint)(lim - pnt));
return -1; return -1;
@ -259,7 +259,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
/* There needs to be at least one label */ /* There needs to be at least one label */
if (prefixlen < 24) { if (prefixlen < 24) {
flog_err(BGP_ERR_UPDATE_RCV, flog_err(EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error" "%s [Error] Update packet error"
" (wrong label length %d)", " (wrong label length %d)",
peer->host, prefixlen); peer->host, prefixlen);
@ -288,7 +288,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
* ignored. * ignored.
*/ */
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: IPv4 labeled-unicast NLRI is multicast address %s, ignoring", "%s: IPv4 labeled-unicast NLRI is multicast address %s, ignoring",
peer->host, inet_ntoa(p.u.prefix4)); peer->host, inet_ntoa(p.u.prefix4));
continue; continue;
@ -301,7 +301,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
char buf[BUFSIZ]; char buf[BUFSIZ];
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: IPv6 labeled-unicast NLRI is link-local address %s, ignoring", "%s: IPv6 labeled-unicast NLRI is link-local address %s, ignoring",
peer->host, peer->host,
inet_ntop(AF_INET6, &p.u.prefix6, buf, inet_ntop(AF_INET6, &p.u.prefix6, buf,
@ -314,7 +314,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
char buf[BUFSIZ]; char buf[BUFSIZ];
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: IPv6 unicast NLRI is multicast address %s, ignoring", "%s: IPv6 unicast NLRI is multicast address %s, ignoring",
peer->host, peer->host,
inet_ntop(AF_INET6, &p.u.prefix6, buf, inet_ntop(AF_INET6, &p.u.prefix6, buf,
@ -338,7 +338,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
/* Packet length consistency check. */ /* Packet length consistency check. */
if (pnt != lim) { if (pnt != lim) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / L-U (%zu data remaining after parsing)", "%s [Error] Update packet error / L-U (%zu data remaining after parsing)",
peer->host, lim - pnt); peer->host, lim - pnt);
return -1; return -1;

View File

@ -127,7 +127,7 @@ static wq_item_status lp_cbq_docallback(struct work_queue *wq, void *data)
if (lcbq->label == MPLS_LABEL_NONE) { if (lcbq->label == MPLS_LABEL_NONE) {
/* shouldn't happen */ /* shouldn't happen */
flog_err(BGP_ERR_LABEL, "%s: error: label==MPLS_LABEL_NONE", flog_err(EC_BGP_LABEL, "%s: error: label==MPLS_LABEL_NONE",
__func__); __func__);
return WQ_SUCCESS; return WQ_SUCCESS;
} }
@ -338,7 +338,7 @@ void bgp_lp_get(
if (rc) { if (rc) {
/* shouldn't happen */ /* shouldn't happen */
flog_err(BGP_ERR_LABEL, flog_err(EC_BGP_LABEL,
"%s: can't insert new LCB into ledger list", "%s: can't insert new LCB into ledger list",
__func__); __func__);
XFREE(MTYPE_BGP_LABEL_CB, lcb); XFREE(MTYPE_BGP_LABEL_CB, lcb);
@ -427,7 +427,7 @@ void bgp_lp_event_chunk(uint8_t keep, uint32_t first, uint32_t last)
struct lp_fifo *lf; struct lp_fifo *lf;
if (last < first) { if (last < first) {
flog_err(BGP_ERR_LABEL, flog_err(EC_BGP_LABEL,
"%s: zebra label chunk invalid: first=%u, last=%u", "%s: zebra label chunk invalid: first=%u, last=%u",
__func__, first, last); __func__, first, last);
return; return;

View File

@ -410,7 +410,7 @@ int main(int argc, char **argv)
if (multipath_num > MULTIPATH_NUM if (multipath_num > MULTIPATH_NUM
|| multipath_num <= 0) { || multipath_num <= 0) {
flog_err( flog_err(
BGP_ERR_MULTIPATH, EC_BGP_MULTIPATH,
"Multipath Number specified must be less than %d and greater than 0", "Multipath Number specified must be less than %d and greater than 0",
MULTIPATH_NUM); MULTIPATH_NUM);
return 1; return 1;

View File

@ -152,7 +152,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
if (prefixlen < VPN_PREFIXLEN_MIN_BYTES * 8) { if (prefixlen < VPN_PREFIXLEN_MIN_BYTES * 8) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / VPN (prefix length %d less than VPN min length)", "%s [Error] Update packet error / VPN (prefix length %d less than VPN min length)",
peer->host, prefixlen); peer->host, prefixlen);
return -1; return -1;
@ -161,7 +161,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
/* sanity check against packet data */ /* sanity check against packet data */
if ((pnt + psize) > lim) { if ((pnt + psize) > lim) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / VPN (prefix length %d exceeds packet size %u)", "%s [Error] Update packet error / VPN (prefix length %d exceeds packet size %u)",
peer->host, prefixlen, (uint)(lim - pnt)); peer->host, prefixlen, (uint)(lim - pnt));
return -1; return -1;
@ -170,7 +170,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
/* sanity check against storage for the IP address portion */ /* sanity check against storage for the IP address portion */
if ((psize - VPN_PREFIXLEN_MIN_BYTES) > (ssize_t)sizeof(p.u)) { if ((psize - VPN_PREFIXLEN_MIN_BYTES) > (ssize_t)sizeof(p.u)) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / VPN (psize %d exceeds storage size %zu)", "%s [Error] Update packet error / VPN (psize %d exceeds storage size %zu)",
peer->host, peer->host,
prefixlen - VPN_PREFIXLEN_MIN_BYTES * 8, prefixlen - VPN_PREFIXLEN_MIN_BYTES * 8,
@ -181,7 +181,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
/* Sanity check against max bitlen of the address family */ /* Sanity check against max bitlen of the address family */
if ((psize - VPN_PREFIXLEN_MIN_BYTES) > prefix_blen(&p)) { if ((psize - VPN_PREFIXLEN_MIN_BYTES) > prefix_blen(&p)) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / VPN (psize %d exceeds family (%u) max byte len %u)", "%s [Error] Update packet error / VPN (psize %d exceeds family (%u) max byte len %u)",
peer->host, peer->host,
prefixlen - VPN_PREFIXLEN_MIN_BYTES * 8, prefixlen - VPN_PREFIXLEN_MIN_BYTES * 8,
@ -218,7 +218,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
#endif #endif
default: default:
flog_err(BGP_ERR_UPDATE_RCV, "Unknown RD type %d", flog_err(EC_BGP_UPDATE_RCV, "Unknown RD type %d",
type); type);
break; /* just report */ break; /* just report */
} }
@ -242,7 +242,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
/* Packet length consistency check. */ /* Packet length consistency check. */
if (pnt != lim) { if (pnt != lim) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / VPN (%zu data remaining after parsing)", "%s [Error] Update packet error / VPN (%zu data remaining after parsing)",
peer->host, lim - pnt); peer->host, lim - pnt);
return -1; return -1;
@ -366,7 +366,7 @@ int vpn_leak_label_callback(
return 0; return 0;
} }
/* Shouldn't happen: different label allocation */ /* Shouldn't happen: different label allocation */
flog_err(BGP_ERR_LABEL, flog_err(EC_BGP_LABEL,
"%s: %s had label %u but got new assignment %u", "%s: %s had label %u but got new assignment %u",
__func__, vp->bgp->name_pretty, vp->tovpn_label, __func__, vp->bgp->name_pretty, vp->tovpn_label,
label); label);

View File

@ -84,7 +84,7 @@ static int bgp_md5_set_socket(int socket, union sockunion *su,
#endif /* HAVE_TCP_MD5SIG */ #endif /* HAVE_TCP_MD5SIG */
if (ret < 0) if (ret < 0)
flog_warn(BGP_WARN_NO_TCP_MD5, flog_warn(EC_BGP_NO_TCP_MD5,
"can't set TCP_MD5SIG option on socket %d: %s", "can't set TCP_MD5SIG option on socket %d: %s",
socket, safe_strerror(en)); socket, safe_strerror(en));
@ -562,7 +562,7 @@ int bgp_connect(struct peer *peer)
sockopt_reuseaddr(peer->fd); sockopt_reuseaddr(peer->fd);
sockopt_reuseport(peer->fd); sockopt_reuseport(peer->fd);
if (sockopt_mark_default(peer->fd, DATAPLANE_MARK, &bgpd_privs) < 0) if (sockopt_mark_default(peer->fd, DATAPLANE_MARK, &bgpd_privs) < 0)
flog_warn(BGP_WARN_NO_SOCKOPT_MARK, flog_warn(EC_BGP_NO_SOCKOPT_MARK,
"Unable to set mark on FD for peer %s, err=%s", "Unable to set mark on FD for peer %s, err=%s",
peer->host, safe_strerror(errno)); peer->host, safe_strerror(errno));
@ -623,7 +623,7 @@ int bgp_getsockname(struct peer *peer)
peer)) { peer)) {
#if defined(HAVE_CUMULUS) #if defined(HAVE_CUMULUS)
flog_err( flog_err(
BGP_ERR_NH_UPD, EC_BGP_NH_UPD,
"%s: nexthop_set failed, resetting connection - intf %p", "%s: nexthop_set failed, resetting connection - intf %p",
peer->host, peer->nexthop.ifp); peer->host, peer->nexthop.ifp);
return -1; return -1;

View File

@ -345,7 +345,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
bgp = bgp_lookup_by_vrf_id(vrf_id); bgp = bgp_lookup_by_vrf_id(vrf_id);
if (!bgp) { if (!bgp) {
flog_err( flog_err(
BGP_ERR_NH_UPD, EC_BGP_NH_UPD,
"parse nexthop update: instance not found for vrf_id %u", "parse nexthop update: instance not found for vrf_id %u",
vrf_id); vrf_id);
return; return;
@ -592,7 +592,7 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
bnc->bgp->vrf_id); bnc->bgp->vrf_id);
/* TBD: handle the failure */ /* TBD: handle the failure */
if (ret < 0) if (ret < 0)
flog_warn(BGP_WARN_ZEBRA_SEND, flog_warn(EC_BGP_ZEBRA_SEND,
"sendmsg_nexthop: zclient_send_message() failed"); "sendmsg_nexthop: zclient_send_message() failed");
if ((command == ZEBRA_NEXTHOP_REGISTER) if ((command == ZEBRA_NEXTHOP_REGISTER)

View File

@ -255,7 +255,7 @@ static int bgp_capability_mp(struct peer *peer, struct capability_header *hdr)
/* Verify length is 4 */ /* Verify length is 4 */
if (hdr->length != 4) { if (hdr->length != 4) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_LENGTH, EC_BGP_CAPABILITY_INVALID_LENGTH,
"MP Cap: Received invalid length %d, non-multiple of 4", "MP Cap: Received invalid length %d, non-multiple of 4",
hdr->length); hdr->length);
return -1; return -1;
@ -451,7 +451,7 @@ static int bgp_capability_restart(struct peer *peer,
/* Verify length is a multiple of 4 */ /* Verify length is a multiple of 4 */
if ((caphdr->length - 2) % 4) { if ((caphdr->length - 2) % 4) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_LENGTH, EC_BGP_CAPABILITY_INVALID_LENGTH,
"Restart Cap: Received invalid length %d, non-multiple of 4", "Restart Cap: Received invalid length %d, non-multiple of 4",
caphdr->length); caphdr->length);
return -1; return -1;
@ -523,7 +523,7 @@ static as_t bgp_capability_as4(struct peer *peer, struct capability_header *hdr)
SET_FLAG(peer->cap, PEER_CAP_AS4_RCV); SET_FLAG(peer->cap, PEER_CAP_AS4_RCV);
if (hdr->length != CAPABILITY_CODE_AS4_LEN) { if (hdr->length != CAPABILITY_CODE_AS4_LEN) {
flog_err(BGP_ERR_PKT_OPEN, flog_err(EC_BGP_PKT_OPEN,
"%s AS4 capability has incorrect data length %d", "%s AS4 capability has incorrect data length %d",
peer->host, hdr->length); peer->host, hdr->length);
return 0; return 0;
@ -549,7 +549,7 @@ static int bgp_capability_addpath(struct peer *peer,
/* Verify length is a multiple of 4 */ /* Verify length is a multiple of 4 */
if (hdr->length % 4) { if (hdr->length % 4) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_LENGTH, EC_BGP_CAPABILITY_INVALID_LENGTH,
"Add Path: Received invalid length %d, non-multiple of 4", "Add Path: Received invalid length %d, non-multiple of 4",
hdr->length); hdr->length);
return -1; return -1;
@ -608,7 +608,7 @@ static int bgp_capability_enhe(struct peer *peer, struct capability_header *hdr)
/* Verify length is a multiple of 4 */ /* Verify length is a multiple of 4 */
if (hdr->length % 6) { if (hdr->length % 6) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_LENGTH, EC_BGP_CAPABILITY_INVALID_LENGTH,
"Extended NH: Received invalid length %d, non-multiple of 6", "Extended NH: Received invalid length %d, non-multiple of 6",
hdr->length); hdr->length);
return -1; return -1;
@ -651,7 +651,7 @@ static int bgp_capability_enhe(struct peer *peer, struct capability_header *hdr)
|| !(safi == SAFI_UNICAST || !(safi == SAFI_UNICAST
|| safi == SAFI_LABELED_UNICAST)) { || safi == SAFI_LABELED_UNICAST)) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_DATA, EC_BGP_CAPABILITY_INVALID_DATA,
"%s Unexpected afi/safi/next-hop afi: %u/%u/%u " "%s Unexpected afi/safi/next-hop afi: %u/%u/%u "
"in Extended Next-hop capability, ignoring", "in Extended Next-hop capability, ignoring",
peer->host, pkt_afi, pkt_safi, pkt_nh_afi); peer->host, pkt_afi, pkt_safi, pkt_nh_afi);
@ -683,7 +683,7 @@ static int bgp_capability_hostname(struct peer *peer,
len = stream_getc(s); len = stream_getc(s);
if (stream_get_getp(s) + len > end) { if (stream_get_getp(s) + len > end) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_DATA, EC_BGP_CAPABILITY_INVALID_DATA,
"%s: Received malformed hostname capability from peer %s", "%s: Received malformed hostname capability from peer %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
return -1; return -1;
@ -714,7 +714,7 @@ static int bgp_capability_hostname(struct peer *peer,
if (stream_get_getp(s) + 1 > end) { if (stream_get_getp(s) + 1 > end) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_DATA, EC_BGP_CAPABILITY_INVALID_DATA,
"%s: Received invalid domain name len (hostname capability) from peer %s", "%s: Received invalid domain name len (hostname capability) from peer %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
return -1; return -1;
@ -723,7 +723,7 @@ static int bgp_capability_hostname(struct peer *peer,
len = stream_getc(s); len = stream_getc(s);
if (stream_get_getp(s) + len > end) { if (stream_get_getp(s) + len > end) {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_DATA, EC_BGP_CAPABILITY_INVALID_DATA,
"%s: Received runt domain name (hostname capability) from peer %s", "%s: Received runt domain name (hostname capability) from peer %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
return -1; return -1;
@ -960,12 +960,12 @@ static int bgp_capability_parse(struct peer *peer, size_t length,
specific specific
capabilities. It seems reasonable for now... capabilities. It seems reasonable for now...
*/ */
flog_warn(BGP_WARN_CAPABILITY_VENDOR, flog_warn(EC_BGP_CAPABILITY_VENDOR,
"%s Vendor specific capability %d", "%s Vendor specific capability %d",
peer->host, caphdr.code); peer->host, caphdr.code);
} else { } else {
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_UNKNOWN, EC_BGP_CAPABILITY_UNKNOWN,
"%s unrecognized capability code: %d - ignored", "%s unrecognized capability code: %d - ignored",
peer->host, caphdr.code); peer->host, caphdr.code);
memcpy(*error, sp, caphdr.length + 2); memcpy(*error, sp, caphdr.length + 2);
@ -981,7 +981,7 @@ static int bgp_capability_parse(struct peer *peer, size_t length,
if (stream_get_getp(s) != (start + caphdr.length)) { if (stream_get_getp(s) != (start + caphdr.length)) {
if (stream_get_getp(s) > (start + caphdr.length)) if (stream_get_getp(s) > (start + caphdr.length))
flog_warn( flog_warn(
BGP_WARN_CAPABILITY_INVALID_LENGTH, EC_BGP_CAPABILITY_INVALID_LENGTH,
"%s Cap-parser for %s read past cap-length, %u!", "%s Cap-parser for %s read past cap-length, %u!",
peer->host, peer->host,
lookup_msg(capcode_str, caphdr.code, lookup_msg(capcode_str, caphdr.code,
@ -1197,7 +1197,7 @@ int bgp_open_option_parse(struct peer *peer, uint8_t length, int *mp_capability)
&& !peer->afc_nego[AFI_IP6][SAFI_ENCAP] && !peer->afc_nego[AFI_IP6][SAFI_ENCAP]
&& !peer->afc_nego[AFI_IP6][SAFI_FLOWSPEC] && !peer->afc_nego[AFI_IP6][SAFI_FLOWSPEC]
&& !peer->afc_nego[AFI_L2VPN][SAFI_EVPN]) { && !peer->afc_nego[AFI_L2VPN][SAFI_EVPN]) {
flog_err(BGP_ERR_PKT_OPEN, flog_err(EC_BGP_PKT_OPEN,
"%s [Error] Configured AFI/SAFIs do not " "%s [Error] Configured AFI/SAFIs do not "
"overlap with received MP capabilities", "overlap with received MP capabilities",
peer->host); peer->host);

View File

@ -1091,7 +1091,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
/* Just in case we have a silly peer who sends AS4 capability set to 0 /* Just in case we have a silly peer who sends AS4 capability set to 0
*/ */
if (CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV) && !as4) { if (CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV) && !as4) {
flog_err(BGP_ERR_PKT_OPEN, flog_err(EC_BGP_PKT_OPEN,
"%s bad OPEN, got AS4 capability, but AS4 set to 0", "%s bad OPEN, got AS4 capability, but AS4 set to 0",
peer->host); peer->host);
bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR, bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR,
@ -1107,7 +1107,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
*/ */
if (as4 == BGP_AS_TRANS) { if (as4 == BGP_AS_TRANS) {
flog_err( flog_err(
BGP_ERR_PKT_OPEN, EC_BGP_PKT_OPEN,
"%s [AS4] NEW speaker using AS_TRANS for AS4, not allowed", "%s [AS4] NEW speaker using AS_TRANS for AS4, not allowed",
peer->host); peer->host);
bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR, bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR,
@ -1137,7 +1137,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
&& as4 != remote_as) { && as4 != remote_as) {
/* raise error, log this, close session */ /* raise error, log this, close session */
flog_err( flog_err(
BGP_ERR_PKT_OPEN, EC_BGP_PKT_OPEN,
"%s bad OPEN, got AS4 capability, but remote_as %u" "%s bad OPEN, got AS4 capability, but remote_as %u"
" mismatch with 16bit 'myasn' %u in open", " mismatch with 16bit 'myasn' %u in open",
peer->host, as4, remote_as); peer->host, as4, remote_as);
@ -1320,7 +1320,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
if (!peer->nexthop.v4.s_addr) { if (!peer->nexthop.v4.s_addr) {
#if defined(HAVE_CUMULUS) #if defined(HAVE_CUMULUS)
flog_err( flog_err(
BGP_ERR_SND_FAIL, EC_BGP_SND_FAIL,
"%s: No local IPv4 addr resetting connection, fd %d", "%s: No local IPv4 addr resetting connection, fd %d",
peer->host, peer->fd); peer->host, peer->fd);
bgp_notify_send(peer, BGP_NOTIFY_CEASE, bgp_notify_send(peer, BGP_NOTIFY_CEASE,
@ -1337,7 +1337,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
if (IN6_IS_ADDR_UNSPECIFIED(&peer->nexthop.v6_global)) { if (IN6_IS_ADDR_UNSPECIFIED(&peer->nexthop.v6_global)) {
#if defined(HAVE_CUMULUS) #if defined(HAVE_CUMULUS)
flog_err( flog_err(
BGP_ERR_SND_FAIL, EC_BGP_SND_FAIL,
"%s: No local IPv6 addr resetting connection, fd %d", "%s: No local IPv6 addr resetting connection, fd %d",
peer->host, peer->fd); peer->host, peer->fd);
bgp_notify_send(peer, BGP_NOTIFY_CEASE, bgp_notify_send(peer, BGP_NOTIFY_CEASE,
@ -1399,7 +1399,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Status must be Established. */ /* Status must be Established. */
if (peer->status != Established) { if (peer->status != Established) {
flog_err(BGP_ERR_INVALID_STATUS, flog_err(EC_BGP_INVALID_STATUS,
"%s [FSM] Update packet received under status %s", "%s [FSM] Update packet received under status %s",
peer->host, peer->host,
lookup_msg(bgp_status_msg, peer->status, NULL)); lookup_msg(bgp_status_msg, peer->status, NULL));
@ -1423,7 +1423,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
Attribute Length + 23 exceeds the message Length), then the Error Attribute Length + 23 exceeds the message Length), then the Error
Subcode is set to Malformed Attribute List. */ Subcode is set to Malformed Attribute List. */
if (stream_pnt(s) + 2 > end) { if (stream_pnt(s) + 2 > end) {
flog_err(BGP_ERR_UPDATE_RCV, flog_err(EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error" "%s [Error] Update packet error"
" (packet length is short for unfeasible length)", " (packet length is short for unfeasible length)",
peer->host); peer->host);
@ -1437,7 +1437,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Unfeasible Route Length check. */ /* Unfeasible Route Length check. */
if (stream_pnt(s) + withdraw_len > end) { if (stream_pnt(s) + withdraw_len > end) {
flog_err(BGP_ERR_UPDATE_RCV, flog_err(EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error" "%s [Error] Update packet error"
" (packet unfeasible length overflow %d)", " (packet unfeasible length overflow %d)",
peer->host, withdraw_len); peer->host, withdraw_len);
@ -1458,7 +1458,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Attribute total length check. */ /* Attribute total length check. */
if (stream_pnt(s) + 2 > end) { if (stream_pnt(s) + 2 > end) {
flog_warn( flog_warn(
BGP_WARN_UPDATE_PACKET_SHORT, EC_BGP_UPDATE_PACKET_SHORT,
"%s [Error] Packet Error (update packet is short for attribute length)", "%s [Error] Packet Error (update packet is short for attribute length)",
peer->host); peer->host);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -1472,7 +1472,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Attribute length check. */ /* Attribute length check. */
if (stream_pnt(s) + attribute_len > end) { if (stream_pnt(s) + attribute_len > end) {
flog_warn( flog_warn(
BGP_WARN_UPDATE_PACKET_LONG, EC_BGP_UPDATE_PACKET_LONG,
"%s [Error] Packet Error (update packet attribute length overflow %d)", "%s [Error] Packet Error (update packet attribute length overflow %d)",
peer->host, attribute_len); peer->host, attribute_len);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -1512,7 +1512,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW) if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW)
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s rcvd UPDATE with errors in attr(s)!! Withdrawing route.", "%s rcvd UPDATE with errors in attr(s)!! Withdrawing route.",
peer->host); peer->host);
@ -1572,7 +1572,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
} }
if (nlri_ret < 0) { if (nlri_ret < 0) {
flog_err(BGP_ERR_UPDATE_RCV, flog_err(EC_BGP_UPDATE_RCV,
"%s [Error] Error parsing NLRI", peer->host); "%s [Error] Error parsing NLRI", peer->host);
if (peer->status == Established) if (peer->status == Established)
bgp_notify_send( bgp_notify_send(
@ -1744,7 +1744,7 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
/* If peer does not have the capability, send notification. */ /* If peer does not have the capability, send notification. */
if (!CHECK_FLAG(peer->cap, PEER_CAP_REFRESH_ADV)) { if (!CHECK_FLAG(peer->cap, PEER_CAP_REFRESH_ADV)) {
flog_err(BGP_ERR_NO_CAP, flog_err(EC_BGP_NO_CAP,
"%s [Error] BGP route refresh is not enabled", "%s [Error] BGP route refresh is not enabled",
peer->host); peer->host);
bgp_notify_send(peer, BGP_NOTIFY_HEADER_ERR, bgp_notify_send(peer, BGP_NOTIFY_HEADER_ERR,
@ -1755,7 +1755,7 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
/* Status must be Established. */ /* Status must be Established. */
if (peer->status != Established) { if (peer->status != Established) {
flog_err( flog_err(
BGP_ERR_INVALID_STATUS, EC_BGP_INVALID_STATUS,
"%s [Error] Route refresh packet received under status %s", "%s [Error] Route refresh packet received under status %s",
peer->host, peer->host,
lookup_msg(bgp_status_msg, peer->status, NULL)); lookup_msg(bgp_status_msg, peer->status, NULL));
@ -2105,7 +2105,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
} }
} else { } else {
flog_warn( flog_warn(
BGP_WARN_UNRECOGNIZED_CAPABILITY, EC_BGP_UNRECOGNIZED_CAPABILITY,
"%s unrecognized capability code: %d - ignored", "%s unrecognized capability code: %d - ignored",
peer->host, hdr->code); peer->host, hdr->code);
} }
@ -2136,7 +2136,7 @@ int bgp_capability_receive(struct peer *peer, bgp_size_t size)
/* If peer does not have the capability, send notification. */ /* If peer does not have the capability, send notification. */
if (!CHECK_FLAG(peer->cap, PEER_CAP_DYNAMIC_ADV)) { if (!CHECK_FLAG(peer->cap, PEER_CAP_DYNAMIC_ADV)) {
flog_err(BGP_ERR_NO_CAP, flog_err(EC_BGP_NO_CAP,
"%s [Error] BGP dynamic capability is not enabled", "%s [Error] BGP dynamic capability is not enabled",
peer->host); peer->host);
bgp_notify_send(peer, BGP_NOTIFY_HEADER_ERR, bgp_notify_send(peer, BGP_NOTIFY_HEADER_ERR,
@ -2147,7 +2147,7 @@ int bgp_capability_receive(struct peer *peer, bgp_size_t size)
/* Status must be Established. */ /* Status must be Established. */
if (peer->status != Established) { if (peer->status != Established) {
flog_err( flog_err(
BGP_ERR_NO_CAP, EC_BGP_NO_CAP,
"%s [Error] Dynamic capability packet received under status %s", "%s [Error] Dynamic capability packet received under status %s",
peer->host, peer->host,
lookup_msg(bgp_status_msg, peer->status, NULL)); lookup_msg(bgp_status_msg, peer->status, NULL));
@ -2229,7 +2229,7 @@ int bgp_process_packet(struct thread *thread)
mprc = bgp_open_receive(peer, size); mprc = bgp_open_receive(peer, size);
if (mprc == BGP_Stop) if (mprc == BGP_Stop)
flog_err( flog_err(
BGP_ERR_PKT_OPEN, EC_BGP_PKT_OPEN,
"%s: BGP OPEN receipt failed for peer: %s", "%s: BGP OPEN receipt failed for peer: %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
break; break;
@ -2240,7 +2240,7 @@ int bgp_process_packet(struct thread *thread)
mprc = bgp_update_receive(peer, size); mprc = bgp_update_receive(peer, size);
if (mprc == BGP_Stop) if (mprc == BGP_Stop)
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: BGP UPDATE receipt failed for peer: %s", "%s: BGP UPDATE receipt failed for peer: %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
break; break;
@ -2250,7 +2250,7 @@ int bgp_process_packet(struct thread *thread)
mprc = bgp_notify_receive(peer, size); mprc = bgp_notify_receive(peer, size);
if (mprc == BGP_Stop) if (mprc == BGP_Stop)
flog_err( flog_err(
BGP_ERR_NOTIFY_RCV, EC_BGP_NOTIFY_RCV,
"%s: BGP NOTIFY receipt failed for peer: %s", "%s: BGP NOTIFY receipt failed for peer: %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
break; break;
@ -2261,7 +2261,7 @@ int bgp_process_packet(struct thread *thread)
mprc = bgp_keepalive_receive(peer, size); mprc = bgp_keepalive_receive(peer, size);
if (mprc == BGP_Stop) if (mprc == BGP_Stop)
flog_err( flog_err(
BGP_ERR_KEEP_RCV, EC_BGP_KEEP_RCV,
"%s: BGP KEEPALIVE receipt failed for peer: %s", "%s: BGP KEEPALIVE receipt failed for peer: %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
break; break;
@ -2272,7 +2272,7 @@ int bgp_process_packet(struct thread *thread)
mprc = bgp_route_refresh_receive(peer, size); mprc = bgp_route_refresh_receive(peer, size);
if (mprc == BGP_Stop) if (mprc == BGP_Stop)
flog_err( flog_err(
BGP_ERR_RFSH_RCV, EC_BGP_RFSH_RCV,
"%s: BGP ROUTEREFRESH receipt failed for peer: %s", "%s: BGP ROUTEREFRESH receipt failed for peer: %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
break; break;
@ -2282,7 +2282,7 @@ int bgp_process_packet(struct thread *thread)
mprc = bgp_capability_receive(peer, size); mprc = bgp_capability_receive(peer, size);
if (mprc == BGP_Stop) if (mprc == BGP_Stop)
flog_err( flog_err(
BGP_ERR_CAP_RCV, EC_BGP_CAP_RCV,
"%s: BGP CAPABILITY receipt failed for peer: %s", "%s: BGP CAPABILITY receipt failed for peer: %s",
__FUNCTION__, peer->host); __FUNCTION__, peer->host);
break; break;

View File

@ -653,7 +653,7 @@ static int bgp_pbr_build_and_validate_entry(struct prefix *p,
action_count++; action_count++;
if (action_count > ACTIONS_MAX_NUM) { if (action_count > ACTIONS_MAX_NUM) {
if (BGP_DEBUG(pbr, PBR_ERROR)) if (BGP_DEBUG(pbr, PBR_ERROR))
flog_err(BGP_ERR_FLOWSPEC_PACKET, flog_err(EC_BGP_FLOWSPEC_PACKET,
"%s: flowspec actions exceeds limit (max %u)", "%s: flowspec actions exceeds limit (max %u)",
__func__, action_count); __func__, action_count);
break; break;
@ -2251,7 +2251,7 @@ void bgp_pbr_update_entry(struct bgp *bgp, struct prefix *p,
if (!bgp_zebra_tm_chunk_obtained()) { if (!bgp_zebra_tm_chunk_obtained()) {
if (BGP_DEBUG(pbr, PBR_ERROR)) if (BGP_DEBUG(pbr, PBR_ERROR))
flog_err(BGP_ERR_TABLE_CHUNK, flog_err(EC_BGP_TABLE_CHUNK,
"%s: table chunk not obtained yet", "%s: table chunk not obtained yet",
__func__); __func__);
return; return;
@ -2259,7 +2259,7 @@ void bgp_pbr_update_entry(struct bgp *bgp, struct prefix *p,
if (bgp_pbr_build_and_validate_entry(p, info, &api) < 0) { if (bgp_pbr_build_and_validate_entry(p, info, &api) < 0) {
if (BGP_DEBUG(pbr, PBR_ERROR)) if (BGP_DEBUG(pbr, PBR_ERROR))
flog_err(BGP_ERR_FLOWSPEC_INSTALLATION, flog_err(EC_BGP_FLOWSPEC_INSTALLATION,
"%s: cancel updating entry %p in bgp pbr", "%s: cancel updating entry %p in bgp pbr",
__func__, info); __func__, info);
return; return;

View File

@ -4216,7 +4216,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
/* Prefix length check. */ /* Prefix length check. */
if (p.prefixlen > prefix_blen(&p) * 8) { if (p.prefixlen > prefix_blen(&p) * 8) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error (wrong prefix length %d for afi %u)", "%s [Error] Update packet error (wrong prefix length %d for afi %u)",
peer->host, p.prefixlen, packet->afi); peer->host, p.prefixlen, packet->afi);
return -1; return -1;
@ -4228,7 +4228,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
/* When packet overflow occur return immediately. */ /* When packet overflow occur return immediately. */
if (pnt + psize > lim) { if (pnt + psize > lim) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error (prefix length %d overflows packet)", "%s [Error] Update packet error (prefix length %d overflows packet)",
peer->host, p.prefixlen); peer->host, p.prefixlen);
return -1; return -1;
@ -4238,7 +4238,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
* prefix */ * prefix */
if (psize > (ssize_t)sizeof(p.u)) { if (psize > (ssize_t)sizeof(p.u)) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error (prefix length %d too large for prefix storage %zu)", "%s [Error] Update packet error (prefix length %d too large for prefix storage %zu)",
peer->host, p.prefixlen, sizeof(p.u)); peer->host, p.prefixlen, sizeof(p.u));
return -1; return -1;
@ -4260,7 +4260,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
* ignored. * ignored.
*/ */
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: IPv4 unicast NLRI is multicast address %s, ignoring", "%s: IPv4 unicast NLRI is multicast address %s, ignoring",
peer->host, inet_ntoa(p.u.prefix4)); peer->host, inet_ntoa(p.u.prefix4));
continue; continue;
@ -4273,7 +4273,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
char buf[BUFSIZ]; char buf[BUFSIZ];
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: IPv6 unicast NLRI is link-local address %s, ignoring", "%s: IPv6 unicast NLRI is link-local address %s, ignoring",
peer->host, peer->host,
inet_ntop(AF_INET6, &p.u.prefix6, buf, inet_ntop(AF_INET6, &p.u.prefix6, buf,
@ -4285,7 +4285,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
char buf[BUFSIZ]; char buf[BUFSIZ];
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s: IPv6 unicast NLRI is multicast address %s, ignoring", "%s: IPv6 unicast NLRI is multicast address %s, ignoring",
peer->host, peer->host,
inet_ntop(AF_INET6, &p.u.prefix6, buf, inet_ntop(AF_INET6, &p.u.prefix6, buf,
@ -4315,7 +4315,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
/* Packet length consistency check. */ /* Packet length consistency check. */
if (pnt != lim) { if (pnt != lim) {
flog_err( flog_err(
BGP_ERR_UPDATE_RCV, EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error (prefix length mismatch with total length)", "%s [Error] Update packet error (prefix length mismatch with total length)",
peer->host); peer->host);
return -1; return -1;

View File

@ -1631,7 +1631,7 @@ void update_group_adjust_peer(struct peer_af *paf)
if (!updgrp) { if (!updgrp) {
updgrp = update_group_create(paf); updgrp = update_group_create(paf);
if (!updgrp) { if (!updgrp) {
flog_err(BGP_ERR_UPDGRP_CREATE, flog_err(EC_BGP_UPDGRP_CREATE,
"couldn't create update group for peer %s", "couldn't create update group for peer %s",
paf->peer->host); paf->peer->host);
return; return;

View File

@ -428,7 +428,7 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
default: default:
/* TODO: handle IPv6 nexthops */ /* TODO: handle IPv6 nexthops */
flog_warn( flog_warn(
BGP_WARN_INVALID_NEXTHOP_LENGTH, EC_BGP_INVALID_NEXTHOP_LENGTH,
"%s: %s: invalid MP nexthop length (AFI IP): %u", "%s: %s: invalid MP nexthop length (AFI IP): %u",
__func__, peer->host, nhlen); __func__, peer->host, nhlen);
stream_free(s); stream_free(s);
@ -534,7 +534,7 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
default: default:
/* TODO: handle IPv4 nexthops */ /* TODO: handle IPv4 nexthops */
flog_warn( flog_warn(
BGP_WARN_INVALID_NEXTHOP_LENGTH, EC_BGP_INVALID_NEXTHOP_LENGTH,
"%s: %s: invalid MP nexthop length (AFI IP6): %u", "%s: %s: invalid MP nexthop length (AFI IP6): %u",
__func__, peer->host, nhlen); __func__, peer->host, nhlen);
stream_free(s); stream_free(s);
@ -790,7 +790,7 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp)
* return */ * return */
if (space_remaining < space_needed) { if (space_remaining < space_needed) {
flog_err( flog_err(
BGP_ERR_UPDGRP_ATTR_LEN, EC_BGP_UPDGRP_ATTR_LEN,
"u%" PRIu64 ":s%" PRIu64 "u%" PRIu64 ":s%" PRIu64
" attributes too long, cannot send UPDATE", " attributes too long, cannot send UPDATE",
subgrp->update_group->id, subgrp->id); subgrp->update_group->id, subgrp->id);

View File

@ -10822,7 +10822,7 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
if (use_json) { if (use_json) {
if (!(json = json_object_new_object())) { if (!(json = json_object_new_object())) {
flog_err( flog_err(
BGP_ERR_JSON_MEM_ERROR, EC_BGP_JSON_MEM_ERROR,
"Unable to allocate memory for JSON object"); "Unable to allocate memory for JSON object");
vty_out(vty, vty_out(vty,
"{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}\n"); "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}\n");

View File

@ -1078,7 +1078,7 @@ int bgp_zebra_get_table_range(uint32_t chunk_size,
return -1; return -1;
ret = tm_get_table_chunk(zclient, chunk_size, start, end); ret = tm_get_table_chunk(zclient, chunk_size, start, end);
if (ret < 0) { if (ret < 0) {
flog_err(BGP_ERR_TABLE_CHUNK, flog_err(EC_BGP_TABLE_CHUNK,
"BGP: Error getting table chunk %u", chunk_size); "BGP: Error getting table chunk %u", chunk_size);
return -1; return -1;
} }
@ -2390,7 +2390,7 @@ static int bgp_zebra_process_local_macip(int command, struct zclient *zclient,
ipa_len = stream_getl(s); ipa_len = stream_getl(s);
if (ipa_len != 0 && ipa_len != IPV4_MAX_BYTELEN if (ipa_len != 0 && ipa_len != IPV4_MAX_BYTELEN
&& ipa_len != IPV6_MAX_BYTELEN) { && ipa_len != IPV6_MAX_BYTELEN) {
flog_err(BGP_ERR_MACIP_LEN, flog_err(EC_BGP_MACIP_LEN,
"%u:Recv MACIP %s with invalid IP addr length %d", "%u:Recv MACIP %s with invalid IP addr length %d",
vrf_id, (command == ZEBRA_MACIP_ADD) ? "Add" : "Del", vrf_id, (command == ZEBRA_MACIP_ADD) ? "Add" : "Del",
ipa_len); ipa_len);
@ -2487,12 +2487,12 @@ static void bgp_zebra_process_label_chunk(
STREAM_GETL(s, last); STREAM_GETL(s, last);
if (zclient->redist_default != proto) { if (zclient->redist_default != proto) {
flog_err(BGP_ERR_LM_ERROR, "Got LM msg with wrong proto %u", flog_err(EC_BGP_LM_ERROR, "Got LM msg with wrong proto %u",
proto); proto);
return; return;
} }
if (zclient->instance != instance) { if (zclient->instance != instance) {
flog_err(BGP_ERR_LM_ERROR, "Got LM msg with wrong instance %u", flog_err(EC_BGP_LM_ERROR, "Got LM msg with wrong instance %u",
proto); proto);
return; return;
} }
@ -2501,7 +2501,7 @@ static void bgp_zebra_process_label_chunk(
first < MPLS_LABEL_UNRESERVED_MIN || first < MPLS_LABEL_UNRESERVED_MIN ||
last > MPLS_LABEL_UNRESERVED_MAX) { last > MPLS_LABEL_UNRESERVED_MAX) {
flog_err(BGP_ERR_LM_ERROR, "%s: Invalid Label chunk: %u - %u", flog_err(EC_BGP_LM_ERROR, "%s: Invalid Label chunk: %u - %u",
__func__, first, last); __func__, first, last);
return; return;
} }

View File

@ -1804,7 +1804,7 @@ static int peer_activate_af(struct peer *peer, afi_t afi, safi_t safi)
int active; int active;
if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) { if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
flog_err(BGP_ERR_PEER_GROUP, "%s was called for peer-group %s", flog_err(EC_BGP_PEER_GROUP, "%s was called for peer-group %s",
__func__, peer->host); __func__, peer->host);
return 1; return 1;
} }
@ -1918,7 +1918,7 @@ static int non_peergroup_deactivate_af(struct peer *peer, afi_t afi,
safi_t safi) safi_t safi)
{ {
if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) { if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
flog_err(BGP_ERR_PEER_GROUP, "%s was called for peer-group %s", flog_err(EC_BGP_PEER_GROUP, "%s was called for peer-group %s",
__func__, peer->host); __func__, peer->host);
return 1; return 1;
} }
@ -1931,7 +1931,7 @@ static int non_peergroup_deactivate_af(struct peer *peer, afi_t afi,
peer->afc[afi][safi] = 0; peer->afc[afi][safi] = 0;
if (peer_af_delete(peer, afi, safi) != 0) { if (peer_af_delete(peer, afi, safi) != 0) {
flog_err(BGP_ERR_PEER_DELETE, flog_err(EC_BGP_PEER_DELETE,
"couldn't delete af structure for peer %s", "couldn't delete af structure for peer %s",
peer->host); peer->host);
return 1; return 1;
@ -1982,7 +1982,7 @@ int peer_deactivate(struct peer *peer, afi_t afi, safi_t safi)
group = peer->group; group = peer->group;
if (peer_af_delete(peer, afi, safi) != 0) { if (peer_af_delete(peer, afi, safi) != 0) {
flog_err(BGP_ERR_PEER_DELETE, flog_err(EC_BGP_PEER_DELETE,
"couldn't delete af structure for peer %s", "couldn't delete af structure for peer %s",
peer->host); peer->host);
} }