- Fix a nasty bug preventing any of the non-default interface's NCEs from being selected
- Fix a bug preventing loopback NCEs from being found (fixes hang in ws2_32:sock winetest)

svn path=/trunk/; revision=59708
This commit is contained in:
Cameron Gutman 2013-08-12 06:00:06 +00:00
parent 84da0d7111
commit a88dd96b21

View file

@ -444,8 +444,6 @@ PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(
TcpipAcquireSpinLock(&NeighborCache[HashValue].Lock, &OldIrql);
NCE = NeighborCache[HashValue].Cache;
/* If there's no adapter specified, we'll look for a match on
* each one. */
if (Interface == NULL)
@ -460,6 +458,7 @@ PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(
do
{
NCE = NeighborCache[HashValue].Cache;
while (NCE != NULL)
{
if (NCE->Interface == Interface &&
@ -477,6 +476,21 @@ PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(
while ((FirstInterface != NULL) &&
((Interface = GetDefaultInterface()) != FirstInterface));
if ((NCE == NULL) && (FirstInterface != NULL))
{
/* This time we'll even match loopback NCEs */
NCE = NeighborCache[HashValue].Cache;
while (NCE != NULL)
{
if (AddrIsEqual(Address, &NCE->Address))
{
break;
}
NCE = NCE->Next;
}
}
TcpipReleaseSpinLock(&NeighborCache[HashValue].Lock, OldIrql);
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));