BGP: add table requesters to senders_list for broadcast propagation to further nodes
This commit is contained in:
1 parent
491f44e05e
commit
ceb94bee7a
1 file changed
+15
-1
+15
-1
@@ -131,7 +131,21 @@ static void route_bgp_receive_cbk(struct ETCP_CONN* from_conn, struct ll_entry*
|
||||
route_bgp_process_withdraw(bgp, from_conn, data, entry->len);
|
||||
} else if (subcmd == ROUTE_SUBCMD_REQUEST_TABLE) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "Received table request from %s", from_conn->log_name);
|
||||
route_bgp_send_nodeinfo(bgp->local_node, from_conn); /* всегда отправляем свой local_node */
|
||||
route_bgp_send_nodeinfo(bgp->local_node, from_conn);
|
||||
bool already = false;
|
||||
struct ll_entry* e = bgp->senders_list ? bgp->senders_list->head : NULL;
|
||||
while (e) {
|
||||
if (((struct ROUTE_BGP_CONN_ITEM*)e->data)->conn == from_conn) { already = true; break; }
|
||||
e = e->next;
|
||||
}
|
||||
if (!already) {
|
||||
struct ll_entry* item_entry = queue_entry_new(sizeof(struct ROUTE_BGP_CONN_ITEM));
|
||||
if (item_entry) {
|
||||
((struct ROUTE_BGP_CONN_ITEM*)item_entry->data)->conn = from_conn;
|
||||
queue_data_put(bgp->senders_list, item_entry);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "Added table requester to senders_list");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
queue_dgram_free(entry);
|
||||
|
||||
Reference in new issue
Block a user