lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #21107] LwIP doesn't reset the TTL in ICMP Echo Replie


From: Tom Evans
Subject: [lwip-devel] [bug #21107] LwIP doesn't reset the TTL in ICMP Echo Replies
Date: Tue, 18 Sep 2007 08:45:05 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MathPlayer 2.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

Follow-up Comment #2, bug #21107 (project lwip):

> But I'm not really sure what you mean with: 
>
>> The LwIP code should set the TTL and then recalculate 
>> (rather than just "adjust") the TTL.

Oops, typo. I meant "Recalculate the IP Checksum".

The ICMP code has the following, so I assumed it was in
charge of the checksum. It is likely that ip_output()
actually recalculates, in which case the following could
be removed:

    /* adjust the checksum */
    if (iecho->chksum >= htons(0xffff - (ICMP_ECHO << 8))) {
      iecho->chksum += htons(ICMP_ECHO << 8) + 1;
    } else {
      iecho->chksum += htons(ICMP_ECHO << 8);
    }

In my code (version 1.2) the call to ip_output_if() is:

    ip_output_if(p, &(iphdr->src), IP_HDRINCL,
     IPH_TTL(iphdr), 0, IP_PROTO_ICMP, inp);

That passes in "IPH_TTL(iphdr)" which looks to me to be
the TTL in the inbound packet and not a request to set to
the default (pcb->ttl) or probably (ICMP_TTL).


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?21107>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]