Branch: refs/heads/misc-bugfixes Home: https://github.com/kronosnet/kronosnet Commit: 8a297a4c83e7a8d8c5189edd877539433a9984c0 https://github.com/kronosnet/kronosnet/commit/8a297a4c83e7a8d8c5189edd877539... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2026-05-31 (Sun, 31 May 2026)
Changed paths: M libknet/tests/api_knet_recv.c M libknet/threads_rx.c M libknet/threads_tx.c
Log Message: ----------- libknet: fix knet_recv buffer size validation for KNET_DATAFD_FLAG_RX_RETURN_INFO
When KNET_DATAFD_FLAG_RX_RETURN_INFO is set, knet_recv sends 2 iovecs: struct knet_datafd_header + packet data. This exceeds KNET_MAX_PACKET_SIZE.
Fix knet_recv to validate buffer size based on channel flags: - With RX_RETURN_INFO: max buffer is KNET_MAX_PACKET_SIZE + sizeof(struct knet_datafd_header) - Without RX_RETURN_INFO: max buffer is KNET_MAX_PACKET_SIZE
Update api_knet_recv test: - Test buffer validation with correct maximum based on flag - Call knet_recv with correct buffer size (header + packet when flag is set) - Fix send_buff size (was incorrectly reduced to make room for header) - Replace manual retry loop with wait_for_packet() (cleaner, no EAGAIN messages)
Signed-off-by: Fabio M. Di Nitto fabbione@kronosnet.org Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
To unsubscribe from these emails, change your notification settings at https://github.com/kronosnet/kronosnet/settings/notifications