The underlying problem was that retryCount was being zeroed on every
iteration of the while loop. Zero it before entering the loop instead.
ApiError apiErr;
int vsockDev = -1;
int family = VMCISock_GetAFValueFd(&vsockDev);
+ int retryCount = 0;
if (family == -1) {
Warning(LGPFX "Couldn't get VMCI socket family info.");
/* We are required to use a privileged source port. */
localPort = PRIVILEGED_PORT_MAX;
while (localPort >= PRIVILEGED_PORT_MIN) {
- int retryCount = 0;
-
fd = SocketConnectVmciInternal(&addr, localPort, &apiErr, &sysErr);
if (fd != INVALID_SOCKET) {
goto done;