krb5_sendto_kdc: Windows no KDC reachable error

The combination of 8740528b24
("Windows-compatible sentinel socket type and value") and
d497d7e4a7 ("krb5_sendto_kdc:
failover for multiple AAAA/A RRs on one domain") broke
all the send to kdc loop on Windows.  rk_socket_t is
a HANDLE and rk_INVALID_SOCKET is the max value.  Therefore,
no valid socket will be larger and all communications
will fail.

Change-Id: I3464f78d67b19f14050ad7a01738fb32bac99385
This commit is contained in:
Jeffrey Altman
2019-05-16 09:27:42 -04:00
committed by Jeffrey Altman
parent bdcd7d2f3d
commit a1276c54aa

View File

@@ -994,7 +994,7 @@ wait_setup(heim_object_t obj, void *iter_ctx, int *stop)
debug_host(wait_ctx->context, 5, h, "invalid sendto host state");
heim_abort("invalid sendto host state");
}
if (h->fd > wait_ctx->max_fd)
if (h->fd > wait_ctx->max_fd || wait_ctx->max_fd == rk_INVALID_SOCKET)
wait_ctx->max_fd = h->fd;
}