mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 00:13:37 +00:00
- Fix GetIpNetTable
- Arp -a will now show a complete list of ARP information svn path=/trunk/; revision=43092
This commit is contained in:
parent
bc07b8444d
commit
c1769578ac
4 changed files with 14 additions and 9 deletions
|
@ -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_ */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue