From 3c8d20a89e715e65afbb1297a848fe28ce67c11c Mon Sep 17 00:00:00 2001 From: Hongpeng Huo Date: Mon, 10 Oct 2022 13:14:28 +0800 Subject: [PATCH] fix: icmp hardware checksum failed for dwc gmac ip core Signed-off-by: Hongpeng Huo --- components/net/lwip-2.1/porting/src/api_shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/net/lwip-2.1/porting/src/api_shell.c b/components/net/lwip-2.1/porting/src/api_shell.c index 3e7323f9..e6aca2ad 100644 --- a/components/net/lwip-2.1/porting/src/api_shell.c +++ b/components/net/lwip-2.1/porting/src/api_shell.c @@ -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) {