In the Linux ABI a send() in a socket that is set non-blocking after a connect can produce ENOTCONN. This is caused by the underlying FreeBSD kernel call sendto() which checks for a connected end point, as this is still in progress, due to socket being non-blocking. The fix is to check this condition in the Linux ABI and instead return EAGAIN which is what linux applications are expecting. N.B. This currently breaks running Call of Duty World at War servers, specifically the server fails to authenticate with the global master server. Fix: Apply the attached patch or derivative there of. Patch attached with submission follows: How-To-Repeat: In a linux application 1. Create a tcp socket 2. Set socket non-blocking 3. Connect to an end point 4. Perform a non-blocking send 5. ENOTCONN is returned.
Responsible Changed From-To: freebsd-bugs->freebsd-emulation Over to maintainer(s).
Any update on this?
Responsible Changed From-To: freebsd-emulation->smh I'll take it.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
(In reply to Steven Hartland from comment #3) Hi, do you have a test program?
I'm afraid I don't its been so many years :(
np, I'll fix this
A commit references this bug: Author: dchagin Date: Sun May 19 09:23:20 UTC 2019 New revision: 347969 URL: https://svnweb.freebsd.org/changeset/base/347969 Log: Linux send() call returns EAGAIN instead of ENOTCONN in case when the socket is non-blocking and connect() is not finished yet. Initial patch developed by Steven Hartland in 2008 and adopted by me. PR: 129169 Reported by: smh@ MFC after: 2 weeks Changes: head/sys/compat/linux/linux_socket.c
A commit references this bug: Author: trasz Date: Mon Aug 24 15:50:58 UTC 2020 New revision: 364695 URL: https://svnweb.freebsd.org/changeset/base/364695 Log: MFC r347969 by dchagin: Linux send() call returns EAGAIN instead of ENOTCONN in case when the socket is non-blocking and connect() is not finished yet. Initial patch developed by Steven Hartland in 2008 and adopted by me. PR: 129169 Changes: _U stable/12/ stable/12/sys/compat/linux/linux_socket.c