https://bugs.winehq.org/show_bug.cgi?id=53058
--- Comment #4 from aman560900@hotmail.com --- (In reply to Zeb Figura from comment #2)
(In reply to Peter from comment #1)
Created attachment 72465 [details] sock.c patch
This is a patch which fixes the issue as far as we can tell and there *shouldn't* be any unintended side effects.
Hmm, I wonder if it's the right place to solve the problem, though. I wonder if we should never be setting DGRAM sockets to SOCK_CONNECTED state in the first place. There are only a few places where SOCK_CONNECTED is treated differently from SOCK_CONNECTIONLESS, but I dont think we have tests for whether any of those should apply to connectionless sockets.
While I can't recommend the solution proposed by Peter as the most correct, it seems to be consistent with the Windows kernel, and at least behaviorally, the Linux kernel as well.
Maybe a better solution would be to prevent connectionless sockets from reaching the SOCK_CONNECTED state?