On 7/14/22 14:29, Paul Gofman wrote:
On 7/14/22 14:03, Zebediah Figura wrote:
Yes, getsockopt() on the client side.
Although it means extra syscalls, these should be fast syscalls (they are just retrieving static data from the socket), and socket code is not really one where syscalls themselves are the bottleneck. We're making at least two server calls for every send/recv operation, not counting the actual send()/recv() call. If syscalls are going to be a problem I suspect there are other avenues we'll need to pursue first.
Makes sense, yeah, an extra native syscall might not be an actual issue in this case. But if I understand correctly ICMP on a datagram socket should work on Windows as well (at least in some way) and in this case it should not be fixed up. I am not sure that winsock ICMP over dgram will currently work correctly in Wine anyway, but not sure making it worse by unrelated fixing up makes sense. I don't seem to be finding any socket option allowing to attach user-defined info to the socket. We could in theory abuse some but that looks weird. Can you think of some way to do it without making it uglier (like abusing some totally unrelated socket option)?
It doesn't seem to be supported for me; creating a socket with IPPROTO_ICMP and SOCK_DGRAM on Windows fails with WSAENOPROTOOPT.