fix: icmp hardware checksum failed for dwc gmac ip core
Signed-off-by: Hongpeng Huo <hongpeng.huo@hpmicro.com>
This commit is contained in:
parent
392e4c2cec
commit
3c8d20a89e
|
@ -373,7 +373,10 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
||||||
while (!ping_kill && (forever || (i < cnt))) {
|
while (!ping_kill && (forever || (i < cnt))) {
|
||||||
iecho->seqno = htons((u16_t)i);
|
iecho->seqno = htons((u16_t)i);
|
||||||
iecho->chksum = 0;
|
iecho->chksum = 0;
|
||||||
|
|
||||||
|
#if (CHECKSUM_GEN_ICMP > 0)
|
||||||
iecho->chksum = inet_chksum((void *)iecho, iecho_len);
|
iecho->chksum = inet_chksum((void *)iecho, iecho_len);
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = sendto(sfd, iecho, iecho_len, 0, (struct sockaddr *)&to, (socklen_t)sizeof(to));
|
ret = sendto(sfd, iecho, iecho_len, 0, (struct sockaddr *)&to, (socklen_t)sizeof(to));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Reference in New Issue