Update Cygwin ICMP service thread for asynchronous pipes
commitdffd81b656a9df97a5f70ec44cf65d85c1242c12
authorMatt Kimball <matt.kimball@gmail.com>
Tue, 24 Oct 2023 02:02:43 +0000 (24 03:02 +0100)
committerMatt Kimball <matt.kimball@gmail.com>
Tue, 24 Oct 2023 02:02:43 +0000 (24 03:02 +0100)
tree631b609aae1952f52667940e2b96178512cb8bc8
parentadfa754a4587790dd31ed2424b592f31c7f25ee0
Update Cygwin ICMP service thread for asynchronous pipes

Recent versions of Cygwin implement pipe() using Windows' named
pipes, and put the read end of the pipe in FILE_PIPE_COMPLETE_OPERATION
mode, which doesn't allow overlapped I/O operations.

For the relevant commit in the Cygwin repository, see
9e4d308cd592fe383dec58ea6523c1b436888ef8

The solution here is to maintain a Windows event object which is
set only when any ICMP requests are pending.  We can do an alertable
wait on that event object, which will allow us to complete ICMP
requests.

Thanks to Adam Schultz for research into this issue and a first
attempt at a fix.
packet/probe_cygwin.c
packet/probe_cygwin.h