delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/13/01:39:51

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 12 Jun 2008 22:39:09 -0700
From: Gary Johnson <garyjohn AT spk DOT agilent DOT com>
To: cygwin AT cygwin DOT com
Subject: Bug in ping? ICMP Sequence Number octets are reversed
Message-ID: <20080613053909.GE9710@suncomp1.spk.agilent.com>
Mail-Followup-To: cygwin AT cygwin DOT com
MIME-Version: 1.0
X-Operating-System: SunOS suncomp1 5.8 sparc
User-Agent: Mutt/1.5.17 (2007-11-01)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I've been using Cygwin's ping (/usr/bin/ping, ping-1.0-1) to do some 
testing of IP over a wireless modem.  In the process, I was trying 
to correlate the icmp_seq values in ping's output with the ICMP 
Sequence Number field values in a log of the IP messages.  What I 
discovered is that the Sequence Number field values increment like 
this:

   0x0000
   0x0100
   0x0200
   0x0300
   ...
   0xfe00
   0xff00
   0x0001
   0x0101
   0x0201
   ...

It looks like someone just wrote a short integer to the sequence 
number field without calling htons() to perform the possible 
little-endian to big-endian conversion.

Granted, RFC 792 doesn't specify how this number is to be 
incremented, and the current behavior is consistent with Windows' 
ping, but this behavior just doesn't seem right.  It also makes is 
slightly more of a pain to correlate my IP log to ping's display.  I 
would compare it to ping on other systems, but I don't have a 
convenient way to sniff those packets.

Regards,
Gary


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019