diff --git a/reactos/dll/win32/iphlpapi/ifenum.h b/reactos/dll/win32/iphlpapi/ifenum.h index 742ad5da8a7..00da02f443f 100644 --- a/reactos/dll/win32/iphlpapi/ifenum.h +++ b/reactos/dll/win32/iphlpapi/ifenum.h @@ -147,4 +147,6 @@ NTSTATUS deleteIpAddress( ULONG NteContext ); /* Inserts a route into the route table. */ DWORD createIpForwardEntryOS(PMIB_IPFORWARDROW pRoute); +BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe ); + #endif /* ndef WINE_IFENUM_H_ */ diff --git a/reactos/dll/win32/iphlpapi/ifenum_reactos.c b/reactos/dll/win32/iphlpapi/ifenum_reactos.c index 90b43211f08..8e8c70c2693 100644 --- a/reactos/dll/win32/iphlpapi/ifenum_reactos.c +++ b/reactos/dll/win32/iphlpapi/ifenum_reactos.c @@ -315,7 +315,7 @@ BOOL isInterface( TDIEntityID *if_maybe ) { if_maybe->tei_entity == IF_ENTITY; } -static BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe ) { +BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe ) { IFEntrySafelySized entryInfo; NTSTATUS status; diff --git a/reactos/dll/win32/iphlpapi/ipstats_reactos.c b/reactos/dll/win32/iphlpapi/ipstats_reactos.c index 4dede14468d..c190221cbb3 100644 --- a/reactos/dll/win32/iphlpapi/ipstats_reactos.c +++ b/reactos/dll/win32/iphlpapi/ipstats_reactos.c @@ -539,7 +539,8 @@ DWORD getNumArpEntries(void) for( i = 0; i < numEntities; i++ ) { if( isInterface( &entitySet[i] ) && - hasArp( tcpFile, &entitySet[i] ) ) { + hasArp( tcpFile, &entitySet[i] ) && + !isLoopback( tcpFile, &entitySet[i] ) ) { status = tdiGetSetOfThings( tcpFile, INFO_CLASS_PROTOCOL, @@ -571,7 +572,7 @@ PMIB_IPNETTABLE getArpTable(void) DWORD numEntities, returnSize; TDIEntityID *entitySet; HANDLE tcpFile; - int i, row = 0, totalNumber; + int i, totalNumber, TmpIdx, CurrIdx = 0; NTSTATUS status; PMIB_IPNETTABLE IpArpTable = NULL; PMIB_IPNETROW AdapterArpTable = NULL; @@ -598,8 +599,9 @@ PMIB_IPNETTABLE getArpTable(void) status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities ); for( i = 0; i < numEntities; i++ ) { - if( isIpEntity( tcpFile, &entitySet[i] ) && - hasArp( tcpFile, &entitySet[i] ) ) { + if( isInterface( &entitySet[i] ) && + hasArp( tcpFile, &entitySet[i] ) && + !isLoopback( tcpFile, &entitySet[i] ) ) { status = tdiGetSetOfThings( tcpFile, INFO_CLASS_PROTOCOL, @@ -613,8 +615,8 @@ PMIB_IPNETTABLE getArpTable(void) &returnSize ); if( status == STATUS_SUCCESS ) { - for( row = 0; row < returnSize; row++ ) - IpArpTable->table[row] = AdapterArpTable[row]; + for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ ) + IpArpTable->table[CurrIdx] = AdapterArpTable[TmpIdx]; } if( AdapterArpTable ) tdiFreeThingSet( AdapterArpTable ); @@ -624,7 +626,7 @@ PMIB_IPNETTABLE getArpTable(void) closeTcpFile( tcpFile ); tdiFreeThingSet( entitySet ); - IpArpTable->dwNumEntries = row; + IpArpTable->dwNumEntries = CurrIdx; return IpArpTable; } diff --git a/reactos/lib/drivers/ip/network/neighbor.c b/reactos/lib/drivers/ip/network/neighbor.c index 87171b95edc..055fc3159d5 100644 --- a/reactos/lib/drivers/ip/network/neighbor.c +++ b/reactos/lib/drivers/ip/network/neighbor.c @@ -490,7 +490,8 @@ ULONG NBCopyNeighbors for( CurNCE = NeighborCache[i].Cache; CurNCE; CurNCE = CurNCE->Next ) { - if( CurNCE->Interface == Interface ) { + if( CurNCE->Interface == Interface && + !AddrIsEqual( &CurNCE->Address, &CurNCE->Interface->Unicast ) ) { if( ArpTable ) { ArpTable[Size].Index = Interface->Index; ArpTable[Size].AddrSize = CurNCE->LinkAddressLength;