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)
Sat, Sep 28, 7:12 PM
Unknown Object (File)
Fri, Sep 27, 5:16 PM
Unknown Object (File)
Fri, Sep 27, 10:18 AM
Unknown Object (File)
Fri, Sep 27, 7:48 AM
Unknown Object (File)
Tue, Sep 24, 4:51 PM
Unknown Object (File)
Tue, Sep 24, 9:17 AM
Unknown Object (File)
Tue, Sep 3, 12:42 PM
Unknown Object (File)
Aug 18 2024, 4:06 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.