PEER_STATUS_EOR_RECEIVED)) {
if (bgp_debug_neighbor_events(peer))
zlog_debug(
- " afi %d safi %d didnt receive EOR",
+ " afi %d safi %d didn't receive EOR",
afi, safi);
return;
}
/* 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) {
- flog_err(BGP_ERR_PKT_OPEN,
- "%s bad OPEN, got AS4 capability, but AS4 set to 0",
- peer->host);
+ flog_err(EC_BGP_PKT_OPEN,
+ "%s bad OPEN, got AS4 capability, but AS4 set to 0",
+ peer->host);
bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR,
BGP_NOTIFY_OPEN_BAD_PEER_AS,
notify_data_remote_as4, 4);
*/
if (as4 == BGP_AS_TRANS) {
flog_err(
- BGP_ERR_PKT_OPEN,
+ EC_BGP_PKT_OPEN,
"%s [AS4] NEW speaker using AS_TRANS for AS4, not allowed",
peer->host);
bgp_notify_send_with_data(peer, BGP_NOTIFY_OPEN_ERR,
&& as4 != remote_as) {
/* raise error, log this, close session */
flog_err(
- BGP_ERR_PKT_OPEN,
+ EC_BGP_PKT_OPEN,
"%s bad OPEN, got AS4 capability, but remote_as %u"
" mismatch with 16bit 'myasn' %u in open",
peer->host, as4, remote_as);
/* Get sockname. */
if ((ret = bgp_getsockname(peer)) < 0) {
- flog_err_sys(LIB_ERR_SOCKET,
+ flog_err_sys(EC_LIB_SOCKET,
"%s: bgp_getsockname() failed for peer: %s",
__FUNCTION__, peer->host);
return BGP_Stop;
if (!peer->nexthop.v4.s_addr) {
#if defined(HAVE_CUMULUS)
flog_err(
- BGP_ERR_SND_FAIL,
+ EC_BGP_SND_FAIL,
"%s: No local IPv4 addr resetting connection, fd %d",
peer->host, peer->fd);
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
if (IN6_IS_ADDR_UNSPECIFIED(&peer->nexthop.v6_global)) {
#if defined(HAVE_CUMULUS)
flog_err(
- BGP_ERR_SND_FAIL,
+ EC_BGP_SND_FAIL,
"%s: No local IPv6 addr resetting connection, fd %d",
peer->host, peer->fd);
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
/* Status must be Established. */
if (peer->status != Established) {
- flog_err(BGP_ERR_INVALID_STATUS,
- "%s [FSM] Update packet received under status %s",
- peer->host,
- lookup_msg(bgp_status_msg, peer->status, NULL));
+ flog_err(EC_BGP_INVALID_STATUS,
+ "%s [FSM] Update packet received under status %s",
+ peer->host,
+ lookup_msg(bgp_status_msg, peer->status, NULL));
bgp_notify_send(peer, BGP_NOTIFY_FSM_ERR, 0);
return BGP_Stop;
}
Attribute Length + 23 exceeds the message Length), then the Error
Subcode is set to Malformed Attribute List. */
if (stream_pnt(s) + 2 > end) {
- flog_err(BGP_ERR_UPDATE_RCV,
- "%s [Error] Update packet error"
- " (packet length is short for unfeasible length)",
- peer->host);
+ flog_err(EC_BGP_UPDATE_RCV,
+ "%s [Error] Update packet error"
+ " (packet length is short for unfeasible length)",
+ peer->host);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR);
return BGP_Stop;
/* Unfeasible Route Length check. */
if (stream_pnt(s) + withdraw_len > end) {
- flog_err(BGP_ERR_UPDATE_RCV,
- "%s [Error] Update packet error"
- " (packet unfeasible length overflow %d)",
- peer->host, withdraw_len);
+ flog_err(EC_BGP_UPDATE_RCV,
+ "%s [Error] Update packet error"
+ " (packet unfeasible length overflow %d)",
+ peer->host, withdraw_len);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR);
return BGP_Stop;
/* Attribute total length check. */
if (stream_pnt(s) + 2 > end) {
flog_warn(
- BGP_WARN_UPDATE_PACKET_SHORT,
+ EC_BGP_UPDATE_PACKET_SHORT,
"%s [Error] Packet Error (update packet is short for attribute length)",
peer->host);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
/* Attribute length check. */
if (stream_pnt(s) + attribute_len > end) {
flog_warn(
- BGP_WARN_UPDATE_PACKET_LONG,
+ EC_BGP_UPDATE_PACKET_LONG,
"%s [Error] Packet Error (update packet attribute length overflow %d)",
peer->host, attribute_len);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW)
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s rcvd UPDATE with errors in attr(s)!! Withdrawing route.",
peer->host);
}
if (nlri_ret < 0) {
- flog_err(BGP_ERR_UPDATE_RCV,
- "%s [Error] Error parsing NLRI", peer->host);
+ flog_err(EC_BGP_UPDATE_RCV,
+ "%s [Error] Error parsing NLRI", peer->host);
if (peer->status == Established)
bgp_notify_send(
peer, BGP_NOTIFY_UPDATE_ERR,
/* If peer does not have the capability, send notification. */
if (!CHECK_FLAG(peer->cap, PEER_CAP_REFRESH_ADV)) {
- flog_err(BGP_ERR_NO_CAP,
- "%s [Error] BGP route refresh is not enabled",
- peer->host);
+ flog_err(EC_BGP_NO_CAP,
+ "%s [Error] BGP route refresh is not enabled",
+ peer->host);
bgp_notify_send(peer, BGP_NOTIFY_HEADER_ERR,
BGP_NOTIFY_HEADER_BAD_MESTYPE);
return BGP_Stop;
/* Status must be Established. */
if (peer->status != Established) {
flog_err(
- BGP_ERR_INVALID_STATUS,
+ EC_BGP_INVALID_STATUS,
"%s [Error] Route refresh packet received under status %s",
peer->host,
lookup_msg(bgp_status_msg, peer->status, NULL));
}
} else {
flog_warn(
- BGP_WARN_UNRECOGNIZED_CAPABILITY,
+ EC_BGP_UNRECOGNIZED_CAPABILITY,
"%s unrecognized capability code: %d - ignored",
peer->host, hdr->code);
}
/* If peer does not have the capability, send notification. */
if (!CHECK_FLAG(peer->cap, PEER_CAP_DYNAMIC_ADV)) {
- flog_err(BGP_ERR_NO_CAP,
- "%s [Error] BGP dynamic capability is not enabled",
- peer->host);
+ flog_err(EC_BGP_NO_CAP,
+ "%s [Error] BGP dynamic capability is not enabled",
+ peer->host);
bgp_notify_send(peer, BGP_NOTIFY_HEADER_ERR,
BGP_NOTIFY_HEADER_BAD_MESTYPE);
return BGP_Stop;
/* Status must be Established. */
if (peer->status != Established) {
flog_err(
- BGP_ERR_NO_CAP,
+ EC_BGP_NO_CAP,
"%s [Error] Dynamic capability packet received under status %s",
peer->host,
lookup_msg(bgp_status_msg, peer->status, NULL));
mprc = bgp_open_receive(peer, size);
if (mprc == BGP_Stop)
flog_err(
- BGP_ERR_PKT_OPEN,
+ EC_BGP_PKT_OPEN,
"%s: BGP OPEN receipt failed for peer: %s",
__FUNCTION__, peer->host);
break;
mprc = bgp_update_receive(peer, size);
if (mprc == BGP_Stop)
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s: BGP UPDATE receipt failed for peer: %s",
__FUNCTION__, peer->host);
break;
mprc = bgp_notify_receive(peer, size);
if (mprc == BGP_Stop)
flog_err(
- BGP_ERR_NOTIFY_RCV,
+ EC_BGP_NOTIFY_RCV,
"%s: BGP NOTIFY receipt failed for peer: %s",
__FUNCTION__, peer->host);
break;
mprc = bgp_keepalive_receive(peer, size);
if (mprc == BGP_Stop)
flog_err(
- BGP_ERR_KEEP_RCV,
+ EC_BGP_KEEP_RCV,
"%s: BGP KEEPALIVE receipt failed for peer: %s",
__FUNCTION__, peer->host);
break;
mprc = bgp_route_refresh_receive(peer, size);
if (mprc == BGP_Stop)
flog_err(
- BGP_ERR_RFSH_RCV,
+ EC_BGP_RFSH_RCV,
"%s: BGP ROUTEREFRESH receipt failed for peer: %s",
__FUNCTION__, peer->host);
break;
mprc = bgp_capability_receive(peer, size);
if (mprc == BGP_Stop)
flog_err(
- BGP_ERR_CAP_RCV,
+ EC_BGP_CAP_RCV,
"%s: BGP CAPABILITY receipt failed for peer: %s",
__FUNCTION__, peer->host);
break;