When SOCK_DGRAM is used, a portion of the datagram is discarded during
the initial recv() when getting the nvlist_header.
To workaround this, use MSG_PEEK for the initial recv() when using a
datagram socket.
Differential D32722
libnv: read entire datagram in nvlist_recv() rew on Oct 29 2021, 12:31 AM. Authored by Tags None Referenced Files
Details
When SOCK_DGRAM is used, a portion of the datagram is discarded during To workaround this, use MSG_PEEK for the initial recv() when using a
Diff Detail
Event TimelineComment Actions add ATF tests for SOCK_DGRAM with nvlist_send()/nvlist_recv(). The test-case nvlist_send_recv__send_many_fds_dgram, wouldn't pass Not sure if this test should be enabled by default. Comment Actions ping @lwhsu Let me know if there's anything I can do to help to get these tests in. If the settings are unacceptable for the test machines, I can atf_skip the offending test. Just to be clear, I've added 3 tests - and only the one test-case needs sysctl tuning to pass. Comment Actions Any objections here? If I don't hear back from @lwhsu , I'll disable the nvlist_send_recv__send_many_fds__dgram test case on commit. |