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)
Mon, Nov 18, 11:24 AM
Unknown Object (File)
Tue, Nov 5, 11:51 AM
Unknown Object (File)
Oct 4 2024, 9:07 PM
Unknown Object (File)
Oct 4 2024, 5:55 PM
Unknown Object (File)
Oct 2 2024, 12:39 PM
Unknown Object (File)
Oct 2 2024, 8:09 AM
Unknown Object (File)
Oct 2 2024, 5:37 AM
Unknown Object (File)
Sep 30 2024, 11:25 PM
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.