fix: memory pool alloc mismatch in tests, db_sync SEND_DATA buffer overflow

- test_etcp_router_reconnect, test_etcp_connect, test_stcp_traffic:
  replace u_calloc with memory_pool_alloc for TOPO_SOCKMETA4/TOPO_ADDR4
- db_sync.c: fix req[14] -> req[15] — SEND_DATA request header is 15 bytes
  (type:1 + from:4 + count:2 + vp:4 + want_from:4)
This commit is contained in:
evgeny committed 2026-07-31 21:44:44 +03:00
1 parent fe9be74e29
commit d310bccf08
52 files changed
+1796 -585

No files matched your search

+3 -3
View File
@@ -23,7 +23,7 @@ _Static_assert(sizeof(struct time_sync_msg) == 9, "time_sync_msg size mismatch")
#define TIME_SYNC_PKT_SIZE (1 + sizeof(struct time_sync_msg)) // cmd(1) + msg(9) = 10
static void ntp_node_on_conn_init(struct ETCP_CONN* conn, void* arg);
static void ntp_node_on_conn_init(struct ETCP_CONN* conn, int event, void* arg);
static void ntp_node_on_new_conn(struct ETCP_CONN* conn, void* arg);
static void ntp_node_recv_cb(struct ETCP_CONN* conn, struct ll_entry* entry);
@@ -103,7 +103,7 @@ static void check_drift(uint64_t node_id, int64_t offset_delta_us) {
}
}
static void ntp_node_on_conn_init(struct ETCP_CONN* conn, void* arg) {
static void ntp_node_on_conn_init(struct ETCP_CONN* conn, int event, void* arg) { (void)event;
struct UTUN_INSTANCE* inst = (struct UTUN_INSTANCE*)arg;
if (!inst || !conn) return;
@@ -117,7 +117,7 @@ static void ntp_node_on_new_conn(struct ETCP_CONN* conn, void* arg) {
if (!conn) return;
struct UTUN_INSTANCE* inst = (struct UTUN_INSTANCE*)arg;
if (!inst) return;
etcp_conn_add_init_cbk(conn, ntp_node_on_conn_init, inst);
etcp_conn_add_cbk(conn, ntp_node_on_conn_init, inst, ETCP_CBK_EVENT_INIT);
}
static void ntp_node_recv_cb(struct ETCP_CONN* conn, struct ll_entry* entry) {