Index: core/ipv4/icmp.c =================================================================== RCS file: /sources/lwip/lwip/src/core/ipv4/icmp.c,v retrieving revision 1.26 diff -u -5 -p -r1.26 icmp.c --- core/ipv4/icmp.c 21 Mar 2007 12:55:00 -0000 1.26 +++ core/ipv4/icmp.c 12 Apr 2007 01:17:15 -0000 @@ -49,11 +49,11 @@ icmp_input(struct pbuf *p, struct netif u8_t type; u8_t code; struct icmp_echo_hdr *iecho; struct ip_hdr *iphdr; struct ip_addr tmpaddr; - u16_t hlen; + u16_t hlen, ttl; ICMP_STATS_INC(icmp.recv); snmp_inc_icmpinmsgs(); @@ -96,10 +96,13 @@ icmp_input(struct pbuf *p, struct netif return; } tmpaddr.addr = iphdr->src.addr; iphdr->src.addr = iphdr->dest.addr; iphdr->dest.addr = tmpaddr.addr; + /* Decrease ttl for reply */ + ttl-- = IPH_TTL(iphdr); + IPH_TTL_SET(iphdr, ttl); ICMPH_TYPE_SET(iecho, ICMP_ER); /* adjust the checksum */ if (iecho->chksum >= htons(0xffff - (ICMP_ECHO << 8))) { iecho->chksum += htons(ICMP_ECHO << 8) + 1; } else {