Branch: refs/heads/misc-bugfixes Home: https://github.com/kronosnet/kronosnet Commit: 104097ea24447d33b81e49ac025a79b17d9f9dbb https://github.com/kronosnet/kronosnet/commit/104097ea24447d33b81e49ac025a79... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2026-05-27 (Wed, 27 May 2026)
Changed paths: M libknet/libknet.h
Log Message: ----------- libknet: document supported file descriptor types for knet_handle_add_datafd
Clarify which fd types work with knet_handle_add_datafd API: - Supported: TAP devices (primary), regular sockets, character devices, bidirectional fds - Unsupported: user-created socketpairs (API limitation), unidirectional pipes, unconnected sockets - Requirement: fd must be bidirectional (knet reads and writes same fd) - Fix typo: KNET_ADD_DAFATA_FLAG_RX_RETURN_INFO → KNET_DATAFD_FLAG_RX_RETURN_INFO
Research showed socketpairs need both fds but API only accepts one, making them fundamentally incompatible with current API design.
Signed-off-by: Fabio M. Di Nitto fabbione@kronosnet.org Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
Commit: de022c905459a1fb46c8c8e30472f7ca939449b9 https://github.com/kronosnet/kronosnet/commit/de022c905459a1fb46c8c8e30472f7... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2026-05-27 (Wed, 27 May 2026)
Changed paths: M libknet/handle_api.c M libknet/tests/api_knet_handle_add_datafd.c
Log Message: ----------- libknet: reject user-provided AF_UNIX socketpairs in knet_handle_add_datafd
Add validation to detect and reject user-provided AF_UNIX socketpairs which fundamentally cannot work with the current API design (knet needs both ends but API only accepts one fd).
Detection method: - Check if fd is a connected AF_UNIX socket via getpeername() - Check if sun_path is empty (characteristic of anonymous socketpairs) - Return EINVAL with clear error message
Extended api_knet_handle_add_datafd test to verify: - SOCK_SEQPACKET socketpairs are rejected - SOCK_DGRAM socketpairs are rejected - Error message guides users to use datafd=0 or TAP devices
This prevents silent failures and confusing timeouts when users attempt to pass socketpairs created with socketpair() to knet.
Signed-off-by: Fabio M. Di Nitto fabbione@kronosnet.org Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
Compare: https://github.com/kronosnet/kronosnet/compare/8dd0d2c117ba...de022c905459
To unsubscribe from these emails, change your notification settings at https://github.com/kronosnet/kronosnet/settings/notifications