Skip to content

Commit

Permalink
bgpd: Refine debug logs for zebra GR registration
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Venkatraman <[email protected]>
  • Loading branch information
vivek-cumulus authored and Pdoijode committed May 29, 2024
1 parent 6510ada commit 5825807
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -3990,6 +3990,11 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
return BGP_GR_FAILURE;
}

if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("%s(%d): Sending GR capability %s to zebra",
bgp->name_pretty, bgp->vrf_id,
disable ? "disabled" : "enabled");

/* Check if capability is already sent. If the flag force is set
* send the capability since this can be initial bgp configuration
*/
Expand All @@ -4005,18 +4010,15 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)

if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, zclient, &api)
== ZCLIENT_SEND_FAILURE) {
zlog_err("%s: %s error sending capability", __func__,
bgp->name_pretty);
zlog_err("%s(%d): Error sending GR capability to zebra",
bgp->name_pretty, bgp->vrf_id);
ret = BGP_GR_FAILURE;
} else {
if (disable)
bgp->present_zebra_gr_state = ZEBRA_GR_DISABLE;
else
bgp->present_zebra_gr_state = ZEBRA_GR_ENABLE;

if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("%s: %s send capabilty success", __func__,
bgp->name_pretty);
ret = BGP_GR_SUCCESS;
}
return ret;
Expand Down

0 comments on commit 5825807

Please sign in to comment.