Browse Source

fix: tgc_phase1_timeout closing all handles including connected ones

topo_upd
evgeny 2 months ago
parent
commit
a0ba6dee21
  1. 12
      src/routing_layer/topo_group_connect.c

12
src/routing_layer/topo_group_connect.c

@ -260,8 +260,16 @@ static void tgc_phase1_timeout(void* arg) {
}
u_free(ids);
for (int i = 0; i < gc->handle_count; i++) { conn_mgr_close(gc->handles[i]); gc->handles[i] = NULL; }
gc->handle_count = 0;
int remaining = 0;
for (int i = 0; i < gc->handle_count; i++) {
struct CONN_MGR_HANDLE* h = gc->handles[i];
if (h && conn_mgr_get_conn(h) != NULL) {
gc->handles[remaining++] = h;
} else {
if (h) conn_mgr_close(h);
}
}
gc->handle_count = remaining;
if (gc->connected_count > 0) {
DEBUG_INFO(DEBUG_CATEGORY_BGP, "%s: Phase1 done — %d connected, skipping Phase 2", TGC_ID, gc->connected_count);

Loading…
Cancel
Save