Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable

From: Shirley Ma <[email-masked]>
Date: Thu, 9 Oct 2003 13:17:35 -0700

Hi, David,

There is possible loss of precision in the new patch for the timestamp. I have 
two solutions. 

Which one do you think is better.

This one is too much math.

ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100
		  + TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);
ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100
		  + TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);

This one might overflow.

ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) *100 ) / HZ;
ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) * 100) / HZ;

Thanks
Shirley Ma
IBM Linux Technology Center
--------------------------------------------