Author: pschweitzer Date: Sat Dec 5 18:29:57 2015 New Revision: 70277
URL: http://svn.reactos.org/svn/reactos?rev=70277&view=rev Log: [TCPIP] DispTdiQueryIpHwAddress(): use the correct function to get the interface associated with an IP address. Also, because local links aren't in the ARP table (obviously), handle them without the mechanism described previously
This fixes arpinging oneself.
Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpip... ============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Sat Dec 5 18:29:57 2015 @@ -1681,6 +1681,27 @@ AddrInitIPv4(&Remote, IPs[0]); AddrInitIPv4(&Local, IPs[1]);
+ if (AddrIsUnspecified(&Remote)) { + Status = STATUS_UNSUCCESSFUL; + goto Exit; + } + + Interface = AddrLocateInterface(&Remote); + if (Interface) { + PVOID OutputBuffer; + + if (Interface->AddressLength > IrpSp->Parameters.DeviceIoControl.OutputBufferLength) { + Status = STATUS_INVALID_BUFFER_SIZE; + goto Exit; + } + + OutputBuffer = Irp->AssociatedIrp.SystemBuffer; + RtlCopyMemory(OutputBuffer, Interface->Address, Interface->AddressLength); + Irp->IoStatus.Information = Interface->AddressLength; + Status = STATUS_SUCCESS; + goto Exit; + } + if (AddrIsUnspecified(&Local)) { NCE = RouteGetRouteToDestination(&Remote); if (NCE == NULL) { @@ -1691,7 +1712,7 @@ Interface = NCE->Interface; } else { - Interface = FindOnLinkInterface(&Local); + Interface = AddrLocateInterface(&Local); if (Interface == NULL) { Status = STATUS_NETWORK_UNREACHABLE; goto Exit;