On Thu, Jun 21, 2018 at 05:51:13PM +0800, Zhiyi Zhang wrote:
On Thu 6 21 17:35, Huw Davies wrote:
On Fri, Jun 15, 2018 at 12:23:23PM +0800, Zhiyi Zhang wrote:
Fix https://bugs.winehq.org/show_bug.cgi?id=43252
The old implementation uses user provided buffer to receive packet data, which is alway not enough, causing data corruptions or incorrectly timeout.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
dlls/iphlpapi/icmp.c | 38 +++++++++++++++++++++++++++------- dlls/iphlpapi/tests/iphlpapi.c | 21 +++++++++++++++---- 2 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c index ebc2f2b65c..7c91443598 100644 --- a/dlls/iphlpapi/icmp.c +++ b/dlls/iphlpapi/icmp.c @@ -113,6 +113,9 @@ typedef struct { #define IP_OPTS_DEFAULT 1 #define IP_OPTS_CUSTOM 2
+#define MAXIPLEN 60 +#define MAXICMPLEN 76
Out of interest, how did you get to 76?
That was copied from https://github.com/iputils/iputils/blob/master/ping.c#L76
I guess it's for errors: 8 for the icmp header, 60 for the original ip header, then 8 for the original icmp header. We probably don't need all of that, but it doesn't hurt.
Huw.