In my test suite runs I occasionally see shutdown(2) fail with
ECONNRESET rather than ENOTCONN. soshutdown(2) will return ENOTCONN if
the socket has been disconnected (synchronized by the socket lock), and
tcp_usr_shutdown() will return ECONNRESET if the inpcb has been dropped
(synchronized by the inpcb lock). I think it's possible to pass the
first check in soshutdown() but fail the second check in
tcp_usr_shutdown(), so modify the KTLS tests to permit this.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 54059 Build 50949: arc lint + arc unit
Event Timeline
Comment Actions
The proper solution might be for tcp_usr_shutdown() to return ENOTCONN in this case instead of ECONNRESET. @glebius do you have any opinions there?
Comment Actions
I didn't do full investigation, but it seems that the inpcb would be dropped if the remote side had reset the connection before we made the shutdown and thus it is ECONNRESET. And if we ourselves had already closed the connection (or never opened it) then it is ENOTCONN. So, if the current code behavior matches the above description, then I think the behavior is correct.
I'll add more subscribers to confirm or refute me. @rrs @tuexen
tests/sys/kern/ktls_test.c | ||
---|---|---|
1907–1908 | And maybe rewrap the last line? |