lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #6760] Ping calculates incorrect checksum


From: Robert Sprowson
Subject: [lwip-devel] [patch #6760] Ping calculates incorrect checksum
Date: Mon, 02 Mar 2009 21:04:27 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

Follow-up Comment #4, patch #6760 (project lwip):

[In ping.c in ping_send() et al we have]

size_t ping_size = sizeof(struct icmp_echo_hdr) + PING_DATA_SIZE;
ping_prepare_echo(iecho, ping_size /* 8 + 64 */); 

[In ping.c in ping_prepare_echo we now have]

data_len = len - sizeof(struct icmp_echo_hdr); /* 72 - 8 */
for(i = 0; i < data_len /* 64 */; i++)
{
}
iecho->chksum = inet_chksum(iecho, len); /* 72 */

[In ping.c we used to have just]
for(i = 0; i < PING_DATA_SIZE /* 64 */; i++)
{
}
iecho->chksum = inet_chksum(iecho, len); /* 72 */


So, you're right it will produce a valid packet, but I don't understand what
the extra changes achievey - we now have to calculate data_len at runtime when
in fact it's always just PING_DATA_SIZE.



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6760>

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





reply via email to

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