!847 解决部分平台ping失败

Merge pull request !847 from huohongpeng/ping_checksum
This commit is contained in:
openharmony_ci 2022-11-03 14:05:50 +00:00 committed by Gitee
commit abbed4430e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 0 deletions

View File

@ -373,7 +373,10 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
while (!ping_kill && (forever || (i < cnt))) {
iecho->seqno = htons((u16_t)i);
iecho->chksum = 0;
#if (CHECKSUM_GEN_ICMP > 0)
iecho->chksum = inet_chksum((void *)iecho, iecho_len);
#endif
ret = sendto(sfd, iecho, iecho_len, 0, (struct sockaddr *)&to, (socklen_t)sizeof(to));
if (ret < 0) {