summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveen Thanikachalam <nthanikachal@vmware.com>2019-08-21 05:16:20 +0200
committerNaveen Thanikachalam <nthanikachal@vmware.com>2019-09-10 07:59:22 +0200
commit4cb5e18ba502d372b35c342bbe512106c2634f5d (patch)
tree4c6c4db0156851014e16a1a7da65f9a5bf0e2c77
parentbgpd: Optimizing route-map's processing of dependencies. (diff)
downloadfrr-4cb5e18ba502d372b35c342bbe512106c2634f5d.tar.xz
frr-4cb5e18ba502d372b35c342bbe512106c2634f5d.zip
BGP: Rectifying the log messages.
This change addresses the following: 1) Ensures logs under DEBUG macro checks are categorized as zlog_debug instead of zlog_info. 2) Error logs are categorized as zlog_err instead of zlog_info. 3) Rephrasing certain logs to make them appear more intuitive. Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
-rw-r--r--bgpd/bgp_attr.c33
-rw-r--r--bgpd/bgp_fsm.c2
-rw-r--r--bgpd/bgp_open.c4
-rw-r--r--bgpd/bgpd.c4
4 files changed, 22 insertions, 21 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index c64d153f1..0440a95ff 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -1647,8 +1647,8 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
#define BGP_MP_REACH_MIN_SIZE 5
#define LEN_LEFT (length - (stream_get_getp(s) - start))
if ((length > STREAM_READABLE(s)) || (length < BGP_MP_REACH_MIN_SIZE)) {
- zlog_info("%s: %s sent invalid length, %lu", __func__,
- peer->host, (unsigned long)length);
+ zlog_info("%s: %s sent invalid length, %lu, of MP_REACH_NLRI",
+ __func__, peer->host, (unsigned long)length);
return BGP_ATTR_PARSE_ERROR_NOTIFYPLS;
}
@@ -1664,7 +1664,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
*/
if (bgp_debug_update(peer, NULL, NULL, 0))
zlog_debug(
- "%s: MP_REACH received AFI %s or SAFI %s is unrecognized",
+ "%s sent unrecognizable AFI, %s or, SAFI, %s, of MP_REACH_NLRI",
peer->host, iana_afi2str(pkt_afi),
iana_safi2str(pkt_safi));
return BGP_ATTR_PARSE_ERROR;
@@ -1675,7 +1675,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
if (LEN_LEFT < attr->mp_nexthop_len) {
zlog_info(
- "%s: %s, MP nexthop length, %u, goes past end of attribute",
+ "%s: %s sent next-hop length, %u, in MP_REACH_NLRI which goes past the end of attribute",
__func__, peer->host, attr->mp_nexthop_len);
return BGP_ATTR_PARSE_ERROR_NOTIFYPLS;
}
@@ -1684,7 +1684,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
switch (attr->mp_nexthop_len) {
case 0:
if (safi != SAFI_FLOWSPEC) {
- zlog_info("%s: (%s) Wrong multiprotocol next hop length: %d",
+ zlog_info("%s: %s sent wrong next-hop length, %d, in MP_REACH_NLRI",
__func__, peer->host, attr->mp_nexthop_len);
return BGP_ATTR_PARSE_ERROR_NOTIFYPLS;
}
@@ -1716,7 +1716,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN);
if (IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_global)) {
if (!peer->nexthop.ifp) {
- zlog_warn("%s: Received a V6/VPNV6 Global attribute but address is a V6 LL and we have no peer interface information, withdrawing",
+ zlog_warn("%s sent a v6 global attribute but address is a V6 LL and there's no peer interface information. Hence, withdrawing",
peer->host);
return BGP_ATTR_PARSE_WITHDRAW;
}
@@ -1733,7 +1733,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN);
if (IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_global)) {
if (!peer->nexthop.ifp) {
- zlog_warn("%s: Received V6/VPNV6 Global and LL attribute but global address is a V6 LL and we have no peer interface information, withdrawing",
+ zlog_warn("%s sent a v6 global and LL attribute but global address is a V6 LL and there's no peer interface information. Hence, withdrawing",
peer->host);
return BGP_ATTR_PARSE_WITHDRAW;
}
@@ -1751,7 +1751,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
if (bgp_debug_update(peer, NULL, NULL, 1))
zlog_debug(
- "%s rcvd nexthops %s, %s -- ignoring non-LL value",
+ "%s sent next-hops %s and %s. Ignoring non-LL value",
peer->host,
inet_ntop(AF_INET6,
&attr->mp_nexthop_global,
@@ -1763,21 +1763,21 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
attr->mp_nexthop_len = IPV6_MAX_BYTELEN;
}
if (!peer->nexthop.ifp) {
- zlog_warn("%s: Received a V6 LL nexthop and we have no peer interface information, withdrawing",
+ zlog_warn("%s sent a v6 LL next-hop and there's no peer interface information. Hence, withdrawing",
peer->host);
return BGP_ATTR_PARSE_WITHDRAW;
}
attr->nh_lla_ifindex = peer->nexthop.ifp->ifindex;
break;
default:
- zlog_info("%s: (%s) Wrong multiprotocol next hop length: %d",
+ zlog_info("%s: %s sent wrong next-hop length, %d, in MP_REACH_NLRI",
__func__, peer->host, attr->mp_nexthop_len);
return BGP_ATTR_PARSE_ERROR_NOTIFYPLS;
}
if (!LEN_LEFT) {
- zlog_info("%s: (%s) Failed to read SNPA and NLRI(s)", __func__,
- peer->host);
+ zlog_info("%s: %s sent SNPA which couldn't be read",
+ __func__, peer->host);
return BGP_ATTR_PARSE_ERROR_NOTIFYPLS;
}
@@ -1793,12 +1793,13 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
/* must have nrli_len, what is left of the attribute */
nlri_len = LEN_LEFT;
if (nlri_len > STREAM_READABLE(s)) {
- zlog_info("%s: (%s) Failed to read NLRI", __func__, peer->host);
+ zlog_info("%s: %s sent MP_REACH_NLRI which couldn't be read",
+ __func__, peer->host);
return BGP_ATTR_PARSE_ERROR_NOTIFYPLS;
}
if (!nlri_len) {
- zlog_info("%s: (%s) No Reachability, Treating as a EOR marker",
+ zlog_info("%s: %s sent a zero-length NLRI. Hence, treating as a EOR marker",
__func__, peer->host);
mp_update->afi = afi;
@@ -2005,8 +2006,8 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */
length -= 4;
if (tlv_length != length) {
- zlog_info("%s: tlv_length(%d) != length(%d)", __func__,
- tlv_length, length);
+ zlog_info("%s: tlv_length(%d) != length(%d)",
+ __func__, tlv_length, length);
}
}
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 4348e6b24..28b3dc501 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1304,7 +1304,7 @@ static int bgp_connect_check(struct thread *thread)
/* If getsockopt is fail, this is fatal error. */
if (ret < 0) {
- zlog_info("can't get sockopt for nonblocking connect: %d(%s)",
+ zlog_err("can't get sockopt for nonblocking connect: %d(%s)",
errno, safe_strerror(errno));
BGP_EVENT_ADD(peer, TCP_fatal_error);
return -1;
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 64529f6ef..03264147a 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -1031,7 +1031,7 @@ as_t peek_for_as4_capability(struct peer *peer, uint8_t length)
as_t as4 = 0;
if (BGP_DEBUG(as4, AS4))
- zlog_info(
+ zlog_debug(
"%s [AS4] rcv OPEN w/ OPTION parameter len: %u,"
" peeking for as4",
peer->host, length);
@@ -1075,7 +1075,7 @@ as_t peek_for_as4_capability(struct peer *peer, uint8_t length)
if (hdr.code == CAPABILITY_CODE_AS4) {
if (BGP_DEBUG(as4, AS4))
- zlog_info(
+ zlog_debug(
"[AS4] found AS4 capability, about to parse");
as4 = bgp_capability_as4(peer, &hdr);
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index b5f267cc3..dc49af476 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2047,7 +2047,7 @@ int peer_activate(struct peer *peer, afi_t afi, safi_t safi)
&& !bgp->allocate_mpls_labels[afi][SAFI_UNICAST]) {
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_info(
+ zlog_debug(
"peer(s) are now active for labeled-unicast, allocate MPLS labels");
bgp->allocate_mpls_labels[afi][SAFI_UNICAST] = 1;
@@ -2150,7 +2150,7 @@ int peer_deactivate(struct peer *peer, afi_t afi, safi_t safi)
&& !bgp_afi_safi_peer_exists(bgp, afi, safi)) {
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_info(
+ zlog_debug(
"peer(s) are no longer active for labeled-unicast, deallocate MPLS labels");
bgp->allocate_mpls_labels[afi][SAFI_UNICAST] = 0;