mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 20:51:30 +00:00
Handle a weird IOCP error for UDP sockets. Fixes #2140
This commit is contained in:
@@ -617,7 +617,9 @@ static void call_read_overlapped(struct nevent *nse) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
err = socket_errno();
|
err = socket_errno();
|
||||||
if (errcode_is_failure(err)) {
|
if (errcode_is_failure(err)) {
|
||||||
eov->err = err;
|
// WSARecvFrom with overlapped I/O may generate ERROR_PORT_UNREACHABLE on ICMP error.
|
||||||
|
// We'll translate that so Nsock-using software doesn't have to know about it.
|
||||||
|
eov->err = (err == ERROR_PORT_UNREACHABLE ? ECONNREFUSED : err);
|
||||||
/* Send the error to the main loop to be picked up by the appropriate handler */
|
/* Send the error to the main loop to be picked up by the appropriate handler */
|
||||||
BOOL bRet = PostQueuedCompletionStatus(iinfo->iocp, -1, (ULONG_PTR)nse->iod, (LPOVERLAPPED)eov);
|
BOOL bRet = PostQueuedCompletionStatus(iinfo->iocp, -1, (ULONG_PTR)nse->iod, (LPOVERLAPPED)eov);
|
||||||
if (!bRet)
|
if (!bRet)
|
||||||
|
|||||||
Reference in New Issue
Block a user