diff --git a/src/route_bgp.c b/src/route_bgp.c index 45168398..f02d2be1 100644 --- a/src/route_bgp.c +++ b/src/route_bgp.c @@ -843,10 +843,12 @@ int route_bgp_process_nodeinfo(struct ROUTE_BGP* bgp, struct ETCP_CONN* from, co struct ROUTE_BGP_CONN_ITEM* item = (struct ROUTE_BGP_CONN_ITEM*)e->data; if (item->conn) { uint64_t id=item->conn->peer_node_id; - int found=0; - for (int i=0; iconn); - else DEBUG_DEBUG(DEBUG_CATEGORY_BGP, "Skip send NODEINFO to node %016llx (loop prevention)",id); + if (id != node_id) { + int found=0; + for (int i=0; iconn); + else DEBUG_DEBUG(DEBUG_CATEGORY_BGP, "Skip send NODEINFO to node %016llx (loop prevention)",id); + } } e = e->next; } @@ -954,6 +956,7 @@ static void route_bgp_add_to_senders(struct ROUTE_BGP* bgp, struct ETCP_CONN* co static bool route_bgp_should_send_to(const struct NODEINFO_Q* nq, uint64_t target_id) { if (!nq || !nq->paths) return false; + if (target_id == nq->node.node_id) return false; struct ll_entry* e = nq->paths->head; while (e) { struct NODEINFO_PATH* path = (struct NODEINFO_PATH*)e; diff --git a/tests/test_bgp_route_exchange.c b/tests/test_bgp_route_exchange.c index ba341fb4..326a9906 100644 --- a/tests/test_bgp_route_exchange.c +++ b/tests/test_bgp_route_exchange.c @@ -291,8 +291,8 @@ static int cond_bgp_c_to_a_gone(void) { // -------------------- Main -------------------- int main(void) { debug_config_init(); - debug_set_level(DEBUG_LEVEL_INFO); - debug_set_categories(DEBUG_CATEGORY_BGP | DEBUG_CATEGORY_ETCP | DEBUG_CATEGORY_CONNECTION); + debug_set_level(DEBUG_LEVEL_ERROR); + debug_set_categories(DEBUG_CATEGORY_BGP); utun_instance_set_tun_init_enabled(0); if (create_temp_configs() != 0) return 1; diff --git a/tests/test_bgp_triangle.c b/tests/test_bgp_triangle.c index d3ab1445..7609dbfd 100644 --- a/tests/test_bgp_triangle.c +++ b/tests/test_bgp_triangle.c @@ -254,8 +254,8 @@ static int cond_c_one_path(void) { return node_path_count(inst_a, NODE_ID_C) == int main(void) { debug_config_init(); - debug_set_level(DEBUG_LEVEL_INFO); - debug_set_categories(DEBUG_CATEGORY_BGP | DEBUG_CATEGORY_ETCP | DEBUG_CATEGORY_CONNECTION); + debug_set_level(DEBUG_LEVEL_ERROR); + debug_set_categories(DEBUG_CATEGORY_BGP); utun_instance_set_tun_init_enabled(0); /* ---------- Pre-generate 5 keypairs ---------- */