Author: cgutman Date: Thu Oct 22 21:08:02 2009 New Revision: 43692
URL: http://svn.reactos.org/svn/reactos?rev=43692&view=rev Log: - 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
Modified: trunk/reactos/lib/drivers/ip/network/arp.c
Modified: trunk/reactos/lib/drivers/ip/network/arp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/arp.... ============================================================================== --- trunk/reactos/lib/drivers/ip/network/arp.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/arp.c [iso-8859-1] Thu Oct 22 21:08:02 2009 @@ -212,11 +212,13 @@ SenderProtoAddress = (PVOID)((ULONG_PTR)SenderHWAddress + Header->HWAddrLen); TargetProtoAddress = (PVOID)((ULONG_PTR)SenderProtoAddress + Header->ProtoAddrLen + Header->HWAddrLen);
+ AddrInitIPv4(&DstAddress, *((PULONG)TargetProtoAddress)); + if (!AddrIsEqual(&DstAddress, &Interface->Unicast)) + return; + + AddrInitIPv4(&SrcAddress, *((PULONG)SenderProtoAddress)); + /* Check if we know the sender */ - - AddrInitIPv4(&SrcAddress, *((PULONG)SenderProtoAddress)); - AddrInitIPv4(&DstAddress, *((PULONG)TargetProtoAddress)); - NCE = NBLocateNeighbor(&SrcAddress); if (NCE) { /* We know the sender. Update the hardware address @@ -230,8 +232,7 @@ 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