[ros-diffs] [cgutman] 43092: - Fix GetIpNetTable - Arp -a will now show a complete list of ARP information

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sun Sep 20 03:37:41 CEST 2009


Author: cgutman
Date: Sun Sep 20 03:37:40 2009
New Revision: 43092

URL: http://svn.reactos.org/svn/reactos?rev=43092&view=rev
Log:
 - Fix GetIpNetTable
 - Arp -a will now show a complete list of ARP information

Modified:
    trunk/reactos/dll/win32/iphlpapi/ifenum.h
    trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c
    trunk/reactos/dll/win32/iphlpapi/ipstats_reactos.c
    trunk/reactos/lib/drivers/ip/network/neighbor.c

Modified: trunk/reactos/dll/win32/iphlpapi/ifenum.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/ifenum.h?rev=43092&r1=43091&r2=43092&view=diff
==============================================================================
--- trunk/reactos/dll/win32/iphlpapi/ifenum.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iphlpapi/ifenum.h [iso-8859-1] Sun Sep 20 03:37:40 2009
@@ -147,4 +147,6 @@
 /* Inserts a route into the route table. */
 DWORD createIpForwardEntryOS(PMIB_IPFORWARDROW pRoute);
 
+BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe );
+
 #endif /* ndef WINE_IFENUM_H_ */

Modified: trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c?rev=43092&r1=43091&r2=43092&view=diff
==============================================================================
--- trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c [iso-8859-1] Sun Sep 20 03:37:40 2009
@@ -315,7 +315,7 @@
         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;
 

Modified: trunk/reactos/dll/win32/iphlpapi/ipstats_reactos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/ipstats_reactos.c?rev=43092&r1=43091&r2=43092&view=diff
==============================================================================
--- trunk/reactos/dll/win32/iphlpapi/ipstats_reactos.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iphlpapi/ipstats_reactos.c [iso-8859-1] Sun Sep 20 03:37:40 2009
@@ -539,7 +539,8 @@
 
     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 @@
     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 @@
     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 @@
 					&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 @@
     closeTcpFile( tcpFile );
 
     tdiFreeThingSet( entitySet );
-    IpArpTable->dwNumEntries = row;
+    IpArpTable->dwNumEntries = CurrIdx;
 
     return IpArpTable;
 }

Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/neighbor.c?rev=43092&r1=43091&r2=43092&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Sun Sep 20 03:37:40 2009
@@ -490,7 +490,8 @@
       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;




More information about the Ros-diffs mailing list