fix BGP: delay up_cbk until connection initialized, fix send_table_request leak
This commit is contained in:
1 parent
a356eedc0d
commit
6c057ca89a
2 files changed
+6
-1
No files matched your search
@@ -148,6 +148,7 @@ struct ETCP_CONN* etcp_connection_create(struct UTUN_INSTANCE* instance, char* n
|
||||
|
||||
|
||||
static void etcp_on_up(struct ETCP_CONN* etcp) {
|
||||
if (!etcp->initialized) return;
|
||||
if (etcp->up_cbk) etcp->up_cbk(etcp, etcp->up_arg);
|
||||
}
|
||||
|
||||
@@ -384,6 +385,7 @@ void etcp_conn_ready(struct ETCP_CONN* conn) {
|
||||
|
||||
// Вызываем callback если установлен
|
||||
if (conn->ready_cbk) conn->ready_cbk(conn, conn->ready_arg);
|
||||
if (conn->links_up) etcp_on_up(conn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-1
@@ -39,7 +39,10 @@ static void route_bgp_send_table_request(struct ROUTE_BGP* bgp, struct ETCP_CONN
|
||||
}
|
||||
e->dgram = (uint8_t*)req;
|
||||
e->len = sizeof(struct BGP_ROUTE_REQUEST);
|
||||
etcp_send(conn, e);
|
||||
if (etcp_send(conn, e) != 0) {
|
||||
u_free(req);
|
||||
queue_entry_free(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void route_bgp_add_to_senders(struct ROUTE_BGP* bgp, struct ETCP_CONN* conn);
|
||||
|
||||
Reference in new issue
Block a user