Changeset 9845e97 for lib


Ignore:
Timestamp:
05/18/18 11:39:59 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, etsilive, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
1f7f10c
Parents:
de060a8
git-author:
Shane Alcock <salcock@…> (05/18/18 11:36:50)
git-committer:
Shane Alcock <salcock@…> (05/18/18 11:39:59)
Message:

Fix bad timestamp conversion for pcapng packets.

Integer division would often cause the nanosecond portion of
the timestamp to always end up being zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapng.c

    rcc9c9de r9845e97  
    11951195
    11961196        ts.tv_sec = (timestamp / interface->tsresol);
    1197         ts.tv_nsec = (uint64_t)(timestamp - (ts.tv_sec * interface->tsresol)) / interface->tsresol * 1000000000;
     1197        ts.tv_nsec = (uint64_t)(timestamp - (ts.tv_sec * interface->tsresol))
     1198                        / ((double)interface->tsresol) * 1000000000;
    11981199
    11991200        return ts;
Note: See TracChangeset for help on using the changeset viewer.