iphlpapi: Return error for IP address with value zero in IcmpSendEcho.
This commit is contained in:
parent
25e0f11ced
commit
1470d7b4cc
|
@ -239,6 +239,11 @@ DWORD WINAPI IcmpSendEcho(
|
||||||
}
|
}
|
||||||
/* check the request size against SO_MAX_MSG_SIZE using getsockopt */
|
/* check the request size against SO_MAX_MSG_SIZE using getsockopt */
|
||||||
|
|
||||||
|
if (!DestinationAddress) {
|
||||||
|
SetLastError(ERROR_INVALID_NETNAME);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Prepare the request */
|
/* Prepare the request */
|
||||||
id=getpid() & 0xFFFF;
|
id=getpid() & 0xFFFF;
|
||||||
seq=InterlockedIncrement(&icmp_sequence) & 0xFFFF;
|
seq=InterlockedIncrement(&icmp_sequence) & 0xFFFF;
|
||||||
|
|
|
@ -906,12 +906,10 @@ todo_wine
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
|
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
todo_wine {
|
|
||||||
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
|
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
|
||||||
ok (error == ERROR_INVALID_NETNAME
|
ok (error == ERROR_INVALID_NETNAME
|
||||||
|| broken(error == IP_BAD_DESTINATION) /* <= 2003 */,
|
|| broken(error == IP_BAD_DESTINATION) /* <= 2003 */,
|
||||||
"expected 1214, got %d\n", error);
|
"expected 1214, got %d\n", error);
|
||||||
}
|
|
||||||
|
|
||||||
address = htonl(INADDR_LOOPBACK);
|
address = htonl(INADDR_LOOPBACK);
|
||||||
if (0) /* crashes in XP */
|
if (0) /* crashes in XP */
|
||||||
|
|
Loading…
Reference in New Issue