From 92269aa253872ce2099ef1d8bf7190fae5d1a542 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 5 Jan 2021 15:03:02 -0500 Subject: [PATCH] bgpd: Allow more detailed knowledge of bgp's internal state When bgp is using wait for install semantics it would be nice to be able to debug it when it is running. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 60ad8d20e9..7e1f7df533 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -10261,6 +10261,24 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, str, label2vni(&attr->label)); } + /* Output some debug about internal state of the dest flags */ + if (json_paths) { + if (CHECK_FLAG(bn->flags, BGP_NODE_PROCESS_SCHEDULED)) + json_object_boolean_true_add(json_path, "processScheduled"); + if (CHECK_FLAG(bn->flags, BGP_NODE_USER_CLEAR)) + json_object_boolean_true_add(json_path, "userCleared"); + if (CHECK_FLAG(bn->flags, BGP_NODE_LABEL_CHANGED)) + json_object_boolean_true_add(json_path, "labelChanged"); + if (CHECK_FLAG(bn->flags, BGP_NODE_REGISTERED_FOR_LABEL)) + json_object_boolean_true_add(json_path, "registeredForLabel"); + if (CHECK_FLAG(bn->flags, BGP_NODE_SELECT_DEFER)) + json_object_boolean_true_add(json_path, "selectDefered"); + if (CHECK_FLAG(bn->flags, BGP_NODE_FIB_INSTALLED)) + json_object_boolean_true_add(json_path, "fibInstalled"); + if (CHECK_FLAG(bn->flags, BGP_NODE_FIB_INSTALL_PENDING)) + json_object_boolean_true_add(json_path, "fibPending"); + } + /* We've constructed the json object for this path, add it to the json * array of paths */ -- 2.39.5