diff options
| -rw-r--r-- | bgpd/bgp_zebra.c | 6 | ||||
| -rw-r--r-- | bgpd/bgp_zebra.h | 2 | ||||
| -rw-r--r-- | pimd/pim_cmd_common.c | 10 | ||||
| -rw-r--r-- | tests/.gitignore | 1 |
4 files changed, 15 insertions, 4 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 430ea0f9a2..1320906339 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1085,7 +1085,7 @@ static void bgp_zebra_tm_connect(struct event *t) } bgp_tm_status_connected = true; if (!bgp_tm_chunk_obtained) { - if (bgp_zebra_get_table_range(bgp_tm_chunk_size, + if (bgp_zebra_get_table_range(zclient, bgp_tm_chunk_size, &bgp_tm_min, &bgp_tm_max) >= 0) { bgp_tm_chunk_obtained = true; @@ -1129,14 +1129,14 @@ void bgp_zebra_init_tm_connect(struct bgp *bgp) &bgp_tm_thread_connect); } -int bgp_zebra_get_table_range(uint32_t chunk_size, +int bgp_zebra_get_table_range(struct zclient *zc, uint32_t chunk_size, uint32_t *start, uint32_t *end) { int ret; if (!bgp_tm_status_connected) return -1; - ret = tm_get_table_chunk(zclient, chunk_size, start, end); + ret = tm_get_table_chunk(zc, chunk_size, start, end); if (ret < 0) { flog_err(EC_BGP_TABLE_CHUNK, "BGP: Error getting table chunk %u", chunk_size); diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h index 3d7d71d9b4..a0f7819460 100644 --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@ -24,7 +24,7 @@ extern void bgp_zebra_init_tm_connect(struct bgp *bgp); extern uint32_t bgp_zebra_tm_get_id(void); extern bool bgp_zebra_tm_chunk_obtained(void); extern void bgp_zebra_destroy(void); -extern int bgp_zebra_get_table_range(uint32_t chunk_size, +extern int bgp_zebra_get_table_range(struct zclient *zc, uint32_t chunk_size, uint32_t *start, uint32_t *end); extern int bgp_if_update_all(void); extern void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 6af19cadd7..716cb8db5b 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -2844,6 +2844,8 @@ static int pim_print_json_pnc_cache_walkcb(struct hash_bucket *backet, json_object *json_row = NULL; json_object *json_ifp = NULL; json_object *json_arr = NULL; + struct pim_interface *pim_ifp = NULL; + bool pim_enable = false; for (nh_node = pnc->nexthop; nh_node; nh_node = nh_node->next) { first_ifindex = nh_node->ifindex; @@ -2863,6 +2865,14 @@ static int pim_print_json_pnc_cache_walkcb(struct hash_bucket *backet, json_ifp = json_object_new_object(); json_object_string_add(json_ifp, "interface", ifp ? ifp->name : "NULL"); + + if (ifp) + pim_ifp = ifp->info; + + if (pim_ifp && pim_ifp->pim_enable) + pim_enable = true; + + json_object_boolean_add(json_ifp, "pimEnabled", pim_enable); #if PIM_IPV == 4 json_object_string_addf(json_ifp, "nexthop", "%pI4", &nh_node->gate.ipv4); diff --git a/tests/.gitignore b/tests/.gitignore index f00177abd8..681438f4a5 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -29,6 +29,7 @@ frr_northbound* /lib/test_buffer /lib/test_checksum /lib/test_frrscript +/lib/test_darr /lib/test_frrlua /lib/test_graph /lib/test_grpc |
