Author: cgutman
Date: Mon Aug 12 06:00:06 2013
New Revision: 59708
URL:
http://svn.reactos.org/svn/reactos?rev=59708&view=rev
Log:
[IP]
- 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)
Modified:
trunk/reactos/lib/drivers/ip/network/neighbor.c
Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Mon Aug 12 06:00:06 2013
@@ -444,8 +444,6 @@
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 @@
do
{
+ NCE = NeighborCache[HashValue].Cache;
while (NCE != NULL)
{
if (NCE->Interface == Interface &&
@@ -476,6 +475,21 @@
}
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);