mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 06:55:55 +00:00
- Move the DstAddress check above the NCE modification code so we don't use ARP requests that aren't addressed to us
- Fixes bug 4879 svn path=/trunk/; revision=43692
This commit is contained in:
parent
80078ade2b
commit
0fba4d8f11
1 changed files with 5 additions and 4 deletions
|
@ -212,11 +212,13 @@ VOID ARPReceive(
|
||||||
SenderProtoAddress = (PVOID)((ULONG_PTR)SenderHWAddress + Header->HWAddrLen);
|
SenderProtoAddress = (PVOID)((ULONG_PTR)SenderHWAddress + Header->HWAddrLen);
|
||||||
TargetProtoAddress = (PVOID)((ULONG_PTR)SenderProtoAddress + Header->ProtoAddrLen + Header->HWAddrLen);
|
TargetProtoAddress = (PVOID)((ULONG_PTR)SenderProtoAddress + Header->ProtoAddrLen + Header->HWAddrLen);
|
||||||
|
|
||||||
/* Check if we know the sender */
|
AddrInitIPv4(&DstAddress, *((PULONG)TargetProtoAddress));
|
||||||
|
if (!AddrIsEqual(&DstAddress, &Interface->Unicast))
|
||||||
|
return;
|
||||||
|
|
||||||
AddrInitIPv4(&SrcAddress, *((PULONG)SenderProtoAddress));
|
AddrInitIPv4(&SrcAddress, *((PULONG)SenderProtoAddress));
|
||||||
AddrInitIPv4(&DstAddress, *((PULONG)TargetProtoAddress));
|
|
||||||
|
|
||||||
|
/* Check if we know the sender */
|
||||||
NCE = NBLocateNeighbor(&SrcAddress);
|
NCE = NBLocateNeighbor(&SrcAddress);
|
||||||
if (NCE) {
|
if (NCE) {
|
||||||
/* We know the sender. Update the hardware address
|
/* We know the sender. Update the hardware address
|
||||||
|
@ -230,8 +232,7 @@ VOID ARPReceive(
|
||||||
Header->HWAddrLen, 0, ARP_TIMEOUT);
|
Header->HWAddrLen, 0, ARP_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Header->Opcode != ARP_OPCODE_REQUEST ||
|
if (Header->Opcode != ARP_OPCODE_REQUEST)
|
||||||
!AddrIsEqual(&DstAddress, &Interface->Unicast))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* This is a request for our address. Swap the addresses and
|
/* This is a request for our address. Swap the addresses and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue