Previous method was truncating the flow hash value when building
the flow_id. It is interesting not to loose the flow hash value
as it can be used in other tools or to interact with a flow that
is still active.
*/
static inline int64_t FlowGetId(const Flow *f)
{
- int64_t id = (int64_t)f->flow_hash << 31 |
- (int64_t)(f->startts.tv_sec & 0x0000FFFF) << 16 |
- (int64_t)(f->startts.tv_usec & 0x0000FFFF);
+ int64_t id = (uint64_t)(f->startts.tv_sec & 0x0000FFFF) << 48 |
+ (uint64_t)(f->startts.tv_usec & 0x0000FFFF) << 32 | (int64_t)f->flow_hash;
/* reduce to 51 bits as Javascript and even JSON often seem to
* max out there. */
id &= 0x7ffffffffffffLL;