Sunc with trunk revision 58971.
[reactos.git] / lib / drivers / lwip / src / core / ipv4 / icmp.c
index 32902a5..47ba857 100644 (file)
@@ -190,12 +190,16 @@ icmp_input(struct pbuf *p, struct netif *inp)
     ip_addr_copy(iphdr->src, *ip_current_dest_addr());
     ip_addr_copy(iphdr->dest, *ip_current_src_addr());
     ICMPH_TYPE_SET(iecho, ICMP_ER);
+#if CHECKSUM_GEN_ICMP
     /* adjust the checksum */
     if (iecho->chksum >= PP_HTONS(0xffffU - (ICMP_ECHO << 8))) {
       iecho->chksum += PP_HTONS(ICMP_ECHO << 8) + 1;
     } else {
       iecho->chksum += PP_HTONS(ICMP_ECHO << 8);
     }
+#else /* CHECKSUM_GEN_ICMP */
+    iecho->chksum = 0;
+#endif /* CHECKSUM_GEN_ICMP */
 
     /* Set the correct TTL and recalculate the header checksum. */
     IPH_TTL_SET(iphdr, ICMP_TTL);