Index: [Article Count Order] [Thread]

Date: Tue, 10 Jan 2006 11:46:52 +0800
From: "Lv Liangying" <Lvly@nanjing-fnst.com>
Subject: [users:00222] v6eval tool bug: IPv4 timestamp option
To: <users@tahi.org>
Message-Id: <035f01c61598$7f87db20$6204a8c0@lly>
X-Mail-Count: 00222

Hello, all:

I found a v6eval bug about IPv4 timestamp option.

In v6eval-3.0.2/lib/Pz/McIPv4.cc
McOpt_IPv4_Timestamp* McOpt_IPv4_Timestamp::create(CSTR key){
McOpt_IPv4_Timestamp* mc =
new McOpt_IPv4_Timestamp(key, OPT_ICVZERO() );
mc->common_member();
mc->member( new MmUint( "Pointer", 8, UN(5), EVALANY() ) );
mc->member( new MmUint( "Overflow", 4, UN(0), EVALANY() ) );
mc->member( new MmUint( "Flag",  4, UN(0), EVALANY() ) );
mc->member( new MmMultiple(
 new MmUint( "Timestamp",8, UN(0), EVALANY() ),
   (METH_HC_MLC)&McOpt_IPv4_Timestamp::HC_MLC(Timestamp) ) );
 // dict
 MmOption_onIPv4::add(mc);  //Hdr_IPv4::option=
 return mc;}

In the above bold displayed section, v6eval define the size of timestamp is 8 bit.
however, according to RFC791([Page 22], Internet Timestamp)
  The Timestamp is a right-justified, 32-bit timestamp in milliseconds since midnight UT. 

So this is a bug in v6eval, and we test timestamp option, if  it set to 8bit, then it will be overflowed.

Below is the patch we issued.

--- v6eval-3.0.2.orig/lib/Pz/McIPv4.cc 2005-11-08 13:39:41.133844064 +0800
+++ v6eval-3.0.2/lib/Pz/McIPv4.cc 2005-11-08 13:41:37.525149896 +0800
@@ -476,7 +476,7 @@
  mc->member( new MmUint( "Overflow", 4, UN(0), EVALANY() ) );
  mc->member( new MmUint( "Flag",  4, UN(0), EVALANY() ) );
  mc->member( new MmMultiple(
-   new MmUint( "Timestamp",8, UN(0), EVALANY() ),
+   new MmUint( "Timestamp",32, UN(0), EVALANY() ),
    (METH_HC_MLC)&McOpt_IPv4_Timestamp::HC_MLC(Timestamp) ) );
  // dict
  MmOption_onIPv4::add(mc);  //Hdr_IPv4::option=


Best Regards, Lv Liangying
	

222_2.html (attatchment)(tag is disabled)