mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
AddrWidenAddress: set type
NBFlushPackets: We already hold the table lock when calling this. svn path=/trunk/; revision=13499
This commit is contained in:
parent
6d7d3aaff6
commit
165794f5c8
2 changed files with 15 additions and 10 deletions
|
@ -86,6 +86,7 @@ UINT AddrCountPrefixBits( PIP_ADDRESS Netmask ) {
|
||||||
VOID AddrWidenAddress( PIP_ADDRESS Network, PIP_ADDRESS Source,
|
VOID AddrWidenAddress( PIP_ADDRESS Network, PIP_ADDRESS Source,
|
||||||
PIP_ADDRESS Netmask ) {
|
PIP_ADDRESS Netmask ) {
|
||||||
if( Netmask->Type == IP_ADDRESS_V4 ) {
|
if( Netmask->Type == IP_ADDRESS_V4 ) {
|
||||||
|
Network->Type = Netmask->Type;
|
||||||
Network->Address.IPv4Address =
|
Network->Address.IPv4Address =
|
||||||
Source->Address.IPv4Address & Netmask->Address.IPv4Address;
|
Source->Address.IPv4Address & Netmask->Address.IPv4Address;
|
||||||
} else {
|
} else {
|
||||||
|
@ -220,8 +221,10 @@ BOOLEAN AddrIsEqual(
|
||||||
PIP_ADDRESS Address1,
|
PIP_ADDRESS Address1,
|
||||||
PIP_ADDRESS Address2)
|
PIP_ADDRESS Address2)
|
||||||
{
|
{
|
||||||
if (Address1->Type != Address2->Type)
|
if (Address1->Type != Address2->Type) {
|
||||||
|
DbgPrint("AddrIsEqual: Unequal Address Types\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
switch (Address1->Type) {
|
switch (Address1->Type) {
|
||||||
case IP_ADDRESS_V4:
|
case IP_ADDRESS_V4:
|
||||||
|
@ -231,6 +234,10 @@ BOOLEAN AddrIsEqual(
|
||||||
return (RtlCompareMemory(&Address1->Address, &Address2->Address,
|
return (RtlCompareMemory(&Address1->Address, &Address2->Address,
|
||||||
sizeof(IPv6_RAW_ADDRESS)) == sizeof(IPv6_RAW_ADDRESS));
|
sizeof(IPv6_RAW_ADDRESS)) == sizeof(IPv6_RAW_ADDRESS));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
DbgPrint("AddrIsEqual: Bad address type\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -52,19 +52,19 @@ VOID NBSendPackets( PNEIGHBOR_CACHE_ENTRY NCE ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Must be called with table lock acquired */
|
||||||
VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE,
|
VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE,
|
||||||
BOOL CallComplete,
|
BOOL CallComplete,
|
||||||
NTSTATUS ErrorCode ) {
|
NTSTATUS ErrorCode ) {
|
||||||
PLIST_ENTRY PacketEntry;
|
PLIST_ENTRY PacketEntry;
|
||||||
PNEIGHBOR_PACKET Packet;
|
PNEIGHBOR_PACKET Packet;
|
||||||
|
|
||||||
PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue,
|
while( !IsListEmpty(&NCE->PacketQueue) ) {
|
||||||
&NCE->Table->Lock);
|
PacketEntry = RemoveHeadList(&NCE->PacketQueue);
|
||||||
while( PacketEntry != NULL ) {
|
|
||||||
Packet = CONTAINING_RECORD
|
Packet = CONTAINING_RECORD
|
||||||
( PacketEntry, NEIGHBOR_PACKET, Next );
|
( PacketEntry, NEIGHBOR_PACKET, Next );
|
||||||
|
|
||||||
ASSERT_KM_POINTER(Packet);
|
ASSERT_KM_POINTER(Packet);
|
||||||
|
|
||||||
TI_DbgPrint
|
TI_DbgPrint
|
||||||
(MID_TRACE,
|
(MID_TRACE,
|
||||||
|
@ -72,16 +72,14 @@ VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE,
|
||||||
PacketEntry, Packet->Packet));
|
PacketEntry, Packet->Packet));
|
||||||
|
|
||||||
if( CallComplete )
|
if( CallComplete )
|
||||||
{
|
{
|
||||||
ASSERT_KM_POINTER(Packet->Complete);
|
ASSERT_KM_POINTER(Packet->Complete);
|
||||||
Packet->Complete( Packet->Context,
|
Packet->Complete( Packet->Context,
|
||||||
Packet->Packet,
|
Packet->Packet,
|
||||||
NDIS_STATUS_REQUEST_ABORTED );
|
NDIS_STATUS_REQUEST_ABORTED );
|
||||||
}
|
}
|
||||||
|
|
||||||
PoolFreeBuffer( Packet );
|
PoolFreeBuffer( Packet );
|
||||||
PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue,
|
|
||||||
&NCE->Table->Lock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue