Page MenuHomeFreeBSD

unix/stream: fix EVFILT_WRITE after we did shutdown(2)
ClosedPublic

Authored by glebius on Sep 1 2025, 10:04 PM.
Tags
None
Referenced Files
F151177002: D52327.id161393.diff
Mon, Apr 6, 3:02 PM
F151129467: D52327.id161347.diff
Mon, Apr 6, 7:01 AM
Unknown Object (File)
Thu, Apr 2, 8:04 AM
Unknown Object (File)
Wed, Apr 1, 9:55 AM
Unknown Object (File)
Wed, Apr 1, 6:50 AM
Unknown Object (File)
Tue, Mar 24, 4:56 AM
Unknown Object (File)
Sun, Mar 15, 4:26 PM
Unknown Object (File)
Sun, Mar 15, 5:11 AM
Subscribers

Details

Summary

When fixing bug 286692, the change eafe5967ac558, that fixed a case when
peer side does close(), also had regressed a case when our side does
shutdown(SHUT_WR). These actually are two independent code paths, and the
eafe5967ac558 shouldn't have touched the second block. The removal of
'kn->kn_flags |= EV_EOF' was incorrect and the statement on original
behavior in the commit message was also incorrect.

Do not add back so_error setting, since I failed to find a test case that
would return anything but 0 in kevent.fflags when run on stable/14.

This was found with help of https://github.com/tokio-rs/mio. Add a test
case into our test suite for that.

Fixes: eafe5967ac558de142d91660e18e9238289890e3

Diff Detail

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