Hi.
I Think I found a bug that I want to report in sockpcb.c, SockCleanPcb().
We have a system that has multiple accept() waiting for Connection. When we change IP-address,
only one of them is signaled and aborted (ECONNABORTED).
What I found out is that the pProtNext is set to NULL in SockClose() and therefor only the first one found is signaled.
I made the following change, marked below.
We are using the latest NDK (2_25_00_09) and recomended xdctools/bios. The problem can be found in eariler NDK:s also.
-----------------------
/* Cycle through all the entries in the socket table. */
ps = pSockList [SockProt];
while (ps != NULL)
{
// Save pProtNext because SockClose() sets it to NULL in SockPcbDetach()
pNextTmp = ps->pProtNext;
/* Clean the entry only if we have a match */
if (ps->LIP == IPAddress) {
/*
* Look for any sockets that are blocked on accept() call
* (fix for SDOCM00115513)
*/
if (ps->OptionFlags & SO_ACCEPTCONN) {
/* Set an error for this socket to force accept() to return */
error = ECONNABORTED;
SockSet((HANDLE)ps, SOL_SOCKET, SO_ERROR, &error,
sizeof(error));
/*
* Wake the socket blocked on accept(), allowing accept() to
* handle the error and return
*/
FdSignalEvent(ps, FD_EVENT_READ);
}
SockClose (ps); // pProtNext = NULL;
}
/* Get the next entry. */
// ps = ps->pProtNext; Doesn't work
ps = pNextTmp;
}
Regards