Page MenuHomeFreeBSD

sendto: don't clear transient errors for atomic protocols
ClosedPublic

Authored by glebius on Feb 17 2022, 5:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 27, 11:01 PM
Unknown Object (File)
Feb 4 2024, 5:20 AM
Unknown Object (File)
Dec 23 2023, 1:21 AM
Unknown Object (File)
Oct 16 2023, 10:45 PM
Unknown Object (File)
Sep 6 2023, 8:20 AM
Unknown Object (File)
Aug 14 2023, 11:19 PM
Unknown Object (File)
Aug 14 2023, 12:49 PM
Unknown Object (File)
Aug 5 2023, 6:39 AM
Subscribers

Details

Summary

The changeset 65572cade35 uncovered the fact that top layer of sendto(2)
would clear a transient error code if some data was copied out of uio.
The clearing of the error makes sense for non-atomic protocols, since
they have sent some data. The atomic protocols send all or nothing.

The current implementation of unix/dgram uses sosend_generic(), which
would always copyout and only then it may fail to deliver a message.
The sosend_dgram(), currently used by UDP only, also has same behavior.

Reported by: pho

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The patch fixed the issue I had observed.

This revision is now accepted and ready to land.Feb 18 2022, 6:27 AM

I wonder why we don't use sosend_dgram() for unix dgram sockets? I tried it and don't see any immediate problems. Though, the problem applies to SEQPACKET sockets too.

I wonder why we don't use sosend_dgram() for unix dgram sockets? I tried it and don't see any immediate problems. Though, the problem applies to SEQPACKET sockets too.

This question is on my table, too. UDP definitely can use sosend_dgram. I will get back to this question after more work on unix/dgram.

Thanks for noticing SEQPACKET. I believe the check for PR_ATOMIC will address it, too.