mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:47:47 +00:00
bgpd: Fix table manager to use the synchronous client
bgp_zebra_tm_connect calls bgp_zebra_get_table_range which
just used the global zclient. Which of course still had
us exposing the global zclient to read and drop important
data from zebra. This fixes commit 787c61e03c
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
b35dbae2c2
commit
1e0b6a601e
@ -1085,7 +1085,7 @@ static void bgp_zebra_tm_connect(struct event *t)
|
|||||||
}
|
}
|
||||||
bgp_tm_status_connected = true;
|
bgp_tm_status_connected = true;
|
||||||
if (!bgp_tm_chunk_obtained) {
|
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_min,
|
||||||
&bgp_tm_max) >= 0) {
|
&bgp_tm_max) >= 0) {
|
||||||
bgp_tm_chunk_obtained = true;
|
bgp_tm_chunk_obtained = true;
|
||||||
@ -1129,14 +1129,14 @@ void bgp_zebra_init_tm_connect(struct bgp *bgp)
|
|||||||
&bgp_tm_thread_connect);
|
&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)
|
uint32_t *start, uint32_t *end)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!bgp_tm_status_connected)
|
if (!bgp_tm_status_connected)
|
||||||
return -1;
|
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) {
|
if (ret < 0) {
|
||||||
flog_err(EC_BGP_TABLE_CHUNK,
|
flog_err(EC_BGP_TABLE_CHUNK,
|
||||||
"BGP: Error getting table chunk %u", chunk_size);
|
"BGP: Error getting table chunk %u", chunk_size);
|
||||||
|
@ -24,7 +24,7 @@ extern void bgp_zebra_init_tm_connect(struct bgp *bgp);
|
|||||||
extern uint32_t bgp_zebra_tm_get_id(void);
|
extern uint32_t bgp_zebra_tm_get_id(void);
|
||||||
extern bool bgp_zebra_tm_chunk_obtained(void);
|
extern bool bgp_zebra_tm_chunk_obtained(void);
|
||||||
extern void bgp_zebra_destroy(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);
|
uint32_t *start, uint32_t *end);
|
||||||
extern int bgp_if_update_all(void);
|
extern int bgp_if_update_all(void);
|
||||||
extern void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
|
extern void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
|
||||||
|
Loading…
Reference in New Issue
Block a user