diff --git a/reactos/drivers/lib/ip/network/address.c b/reactos/drivers/lib/ip/network/address.c index 38194a34c0b..1631efdda81 100644 --- a/reactos/drivers/lib/ip/network/address.c +++ b/reactos/drivers/lib/ip/network/address.c @@ -86,6 +86,7 @@ UINT AddrCountPrefixBits( PIP_ADDRESS Netmask ) { VOID AddrWidenAddress( PIP_ADDRESS Network, PIP_ADDRESS Source, PIP_ADDRESS Netmask ) { if( Netmask->Type == IP_ADDRESS_V4 ) { + Network->Type = Netmask->Type; Network->Address.IPv4Address = Source->Address.IPv4Address & Netmask->Address.IPv4Address; } else { @@ -220,8 +221,10 @@ BOOLEAN AddrIsEqual( PIP_ADDRESS Address1, PIP_ADDRESS Address2) { - if (Address1->Type != Address2->Type) + if (Address1->Type != Address2->Type) { + DbgPrint("AddrIsEqual: Unequal Address Types\n"); return FALSE; + } switch (Address1->Type) { case IP_ADDRESS_V4: @@ -231,6 +234,10 @@ BOOLEAN AddrIsEqual( return (RtlCompareMemory(&Address1->Address, &Address2->Address, sizeof(IPv6_RAW_ADDRESS)) == sizeof(IPv6_RAW_ADDRESS)); break; + + default: + DbgPrint("AddrIsEqual: Bad address type\n"); + break; } return FALSE; diff --git a/reactos/drivers/lib/ip/network/neighbor.c b/reactos/drivers/lib/ip/network/neighbor.c index b21f6f3df58..99e9bbf6e55 100644 --- a/reactos/drivers/lib/ip/network/neighbor.c +++ b/reactos/drivers/lib/ip/network/neighbor.c @@ -52,19 +52,19 @@ VOID NBSendPackets( PNEIGHBOR_CACHE_ENTRY NCE ) { } } +/* Must be called with table lock acquired */ VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE, BOOL CallComplete, NTSTATUS ErrorCode ) { PLIST_ENTRY PacketEntry; PNEIGHBOR_PACKET Packet; - PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue, - &NCE->Table->Lock); - while( PacketEntry != NULL ) { + while( !IsListEmpty(&NCE->PacketQueue) ) { + PacketEntry = RemoveHeadList(&NCE->PacketQueue); Packet = CONTAINING_RECORD ( PacketEntry, NEIGHBOR_PACKET, Next ); - ASSERT_KM_POINTER(Packet); + ASSERT_KM_POINTER(Packet); TI_DbgPrint (MID_TRACE, @@ -72,16 +72,14 @@ VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE, PacketEntry, Packet->Packet)); if( CallComplete ) - { - ASSERT_KM_POINTER(Packet->Complete); + { + ASSERT_KM_POINTER(Packet->Complete); Packet->Complete( Packet->Context, Packet->Packet, NDIS_STATUS_REQUEST_ABORTED ); - } + } PoolFreeBuffer( Packet ); - PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue, - &NCE->Table->Lock); } }