Browse Source

Fixed bug #21107 (didn't reset IP TTL in ICMP echo replies)

STABLE-2_1_x
goldsimon 19 years ago
parent
commit
0bf32b957d
  1. 3
      CHANGELOG
  2. 8
      src/core/ipv4/icmp.c

3
CHANGELOG

@ -405,6 +405,9 @@ HISTORY
++ Bug fixes:
2007-09-19 Simon Goldschmidt
* icmp.c: Fixed bug #21107 (didn't reset IP TTL in ICMP echo replies)
2007-09-06 Frédéric Bernon
* several-files: replace some #include "arch/cc.h" by "lwip/arch.h", or simply remove
it as long as "lwip/opt.h" is included before (this one include "lwip/debug.h" which

8
src/core/ipv4/icmp.c

@ -163,6 +163,14 @@ icmp_input(struct pbuf *p, struct netif *inp)
} else {
iecho->chksum += htons(ICMP_ECHO << 8);
}
/* Set the correct TTL and recalculate the header checksum. */
IPH_TTL_SET(iphdr, ICMP_TTL);
IPH_CHKSUM_SET(iphdr, 0);
#if CHECKSUM_GEN_IP
IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
#endif /* CHECKSUM_GEN_IP */
ICMP_STATS_INC(icmp.xmit);
/* increase number of messages attempted to send */
snmp_inc_icmpoutmsgs();

Loading…
Cancel
Save