From b8da0db1abc0cf0f9ca24f606b65f9f1593001ba Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 4 Jun 2026 01:17:32 +0300 Subject: [PATCH] debug: add final offset/to_add/data_len log before encrypt_send INIT_REQ/INIT_RESP now log offset, s, to_add, data_len, noencrypt_len right before etcp_encrypt_send to trace why enc_buf exceeds mtu. --- src/etcp_connections.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/etcp_connections.c b/src/etcp_connections.c index e4427987..8c29084e 100644 --- a/src/etcp_connections.c +++ b/src/etcp_connections.c @@ -162,6 +162,8 @@ static void etcp_link_send_init(struct ETCP_LINK* link, uint8_t reset) { dgram->data_len = offset; + DEBUG_ERROR(DEBUG_CATEGORY_CONNECTION, "INIT_REQ final: offset=%zu s=%d to_add=%d data_len=%d noenc=%d", + offset, s, to_add, (int)dgram->data_len, (int)dgram->noencrypt_len); DEBUG_INFO(DEBUG_CATEGORY_CONNECTION, "Sending INIT request to link, node_id=%016llx, retry=%d", (unsigned long long)node_id, link->init_retry_count); @@ -1546,6 +1548,8 @@ void etcp_connections_read_callback_socket(socket_t sock, void* arg) { for (int i=0; idata[xoffset++]=rand();// fill pad // padding end pkt->data_len=xoffset; + DEBUG_ERROR(DEBUG_CATEGORY_CONNECTION, "INIT_RESP final: xoffset=%d s=%d to_add=%d data_len=%d noenc=%d", + xoffset, s, to_add, (int)pkt->data_len, (int)pkt->noencrypt_len); DEBUG_DEBUG(DEBUG_CATEGORY_CONNECTION, "Sending INIT RESPONSE, link=%p, local_link_id=%d, remote_link_id=%d", link, link->local_link_id, link->remote_link_id); DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[ETCP DEBUG] Send INIT RESPONSE");