AddrWidenAddress: set type

NBFlushPackets: We already hold the table lock when calling this.

svn path=/trunk/; revision=13499
This commit is contained in:
Art Yerkes 2005-02-12 03:53:19 +00:00
parent 6d7d3aaff6
commit 165794f5c8
2 changed files with 15 additions and 10 deletions

View file

@ -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;

View file

@ -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);
}
}