Peter Haag | 28 Jun 2008 18:20
Picon
Favicon

Re: Implementation of overflow correction of SysUptime counter in netflow_v*.c


Hi Daan

Many thanks for your input.
I'm currently out of the office, and will check this, when I'm back.

Many thanks

	- Peter

Daan van der Sanden wrote:
| Hi,
|
| In both netflow_v5_v7.c and netflow_v9.c is an error in handling an overflow
| of the SysUptime counter. However I can't test this it at the moment, because
| I don't have any packet in which there is an overflow of SysUptime, but going
| through the c-code I think it is wrong (unless I'm missing something
| obvious).
|
| This is the part where the header gets read:
| v5_header->SysUptime     = ntohl(v5_header->SysUptime);
| v5_header->unix_secs     = ntohl(v5_header->unix_secs);
| v5_header->unix_nsecs    = ntohl(v5_header->unix_nsecs);
|
| /* calculate boot time in msec */
| boot_time  = ((uint64_t)(v5_header->unix_secs)*1000 +
|   ((uint64_t(v5_header->unix_nsecs) / 1000000) ) -
|     (uint64_t)(v5_header->SysUptime);
|
| And here where the overflow correction takes place, when a flow record is
(Continue reading)


Gmane