lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #26658] ping tool ICMP checksum error.


From: hanhui
Subject: [lwip-devel] [bug #26658] ping tool ICMP checksum error.
Date: Sun, 24 May 2009 12:24:04 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; MEGAUPLOAD 2.0)

URL:
  <http://savannah.nongnu.org/bugs/?26658>

                 Summary: ping tool ICMP checksum error.
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: hanhui03
            Submitted on: Sun May 24 12:24:03 2009
                Category: Contrib
                Severity: 3 - Normal
              Item Group: Change Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.3.0

    _______________________________________________________

Details:

----------------CODE--------------------

function: ping_prepare_echo()
  ...
  iecho->seqno  = htons(++ping_seq_num);
  iecho->chksum = inet_chksum(iecho, len);

  /* fill the additional data buffer with some data */
  for(i = 0; i < PING_DATA_SIZE; i++) {
    ((char*)iecho)[sizeof(struct icmp_echo_hdr) + i] = i;
  }
  ...
----------------------------------------

I think first fill data and then calculate check sum

should be:
  
  ...
  iecho->seqno  = htons(++ping_seq_num);
  
  /* fill the additional data buffer with some data */
  for(i = 0; i < PING_DATA_SIZE; i++) {
    ((char*)iecho)[sizeof(struct icmp_echo_hdr) + i] = i;
  }
  iecho->chksum = inet_chksum(iecho, len);
  ...





    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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