From: Cameron Gutman Date: Thu, 22 Oct 2009 19:08:02 +0000 (+0000) Subject: - Move the DstAddress check above the NCE modification code so we don't use ARP... X-Git-Tag: ReactOS-0.3.11~338 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=0fba4d8f1126f7bce8991f605b13033facea975a - 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 --- diff --git a/reactos/lib/drivers/ip/network/arp.c b/reactos/lib/drivers/ip/network/arp.c index 368b718e03f..a24ff20740a 100644 --- a/reactos/lib/drivers/ip/network/arp.c +++ b/reactos/lib/drivers/ip/network/arp.c @@ -212,11 +212,13 @@ VOID ARPReceive( SenderProtoAddress = (PVOID)((ULONG_PTR)SenderHWAddress + 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(&DstAddress, *((PULONG)TargetProtoAddress)); + /* Check if we know the sender */ NCE = NBLocateNeighbor(&SrcAddress); if (NCE) { /* We know the sender. Update the hardware address @@ -230,8 +232,7 @@ VOID ARPReceive( Header->HWAddrLen, 0, ARP_TIMEOUT); } - if (Header->Opcode != ARP_OPCODE_REQUEST || - !AddrIsEqual(&DstAddress, &Interface->Unicast)) + if (Header->Opcode != ARP_OPCODE_REQUEST) return; /* This is a request for our address. Swap the addresses and