http://bugs.winehq.org/show_bug.cgi?id=11640
Jeff Zaroyko jeffzaroyko@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeffzaroyko@gmail.com
--- Comment #8 from Jeff Zaroyko jeffzaroyko@gmail.com 2008-03-24 01:23:44 --- (In reply to comment #6)
Created an attachment (id=11542)
--> (http://bugs.winehq.org/attachment.cgi?id=11542) [details]
Trying to host
This is what I get, when I try to host.
(In reply to comment #2)
It looks like connected udp sockets are not catered to in ws_sockaddr_u2ws after being called in WS2_recv. The msghdr struct contains a member msg_namelen which is zero when msg_name is not set after recv is called. This is the reason for the fixme's being printed, as a switch statement switches on uninitialized data.
An update:
After some digging, I think, the "fixme:winsock:ws_sockaddr_u2ws Unknown address family" messages occur due to how tcp (not udp, I misspoke) is implemented on Linux and subsequently in wine an assumption made in WS2_recv that the msg_name member of the hdr parameter to recvmsg is always updated.
for reference, this is from a recent Linux 2.6 source tree, net/ipv4/tcp.c /* According to UNIX98, msg_name/msg_namelen are ignored * on connected socket. I was just happy when found this 8) --ANK */
My tests lead me to believe that msg_name is not updated on connected tcp sockets, that is, connect a tcp socket, call send() on it to send some data, then call recvfrom - which will cause ws_sockaddr_u2ws to be entered and the reading of initialized data occurs and the default case is reached where the Unknown address family message is printed.
In its current form, Linux appears to set the msg_namelen to zero if recvmsg is called on a connected tcp socket and msg_name is not updated with address details.
This differs from Windows, according to my interpretation of msdn, calling recvfrom does guarantee that address details are always updated.
I'm working on a test that can be added to the tests for ws2_32 and a possible fix also.