Until now the time out handling in defrag was done using a single
uint32_t that tracked seconds. This lead to corner cases, where
defrag trackers could be timed out a little too early.
}
/* retain if remove is not set and not timed out */
- if (!dt->remove && dt->timeout > (uint32_t)ts->tv_sec)
+ if (!dt->remove && timercmp(&dt->timeout, ts, >))
return 0;
return 1;
}
/* Update timeout. */
- tracker->timeout = p->ts.tv_sec + tracker->host_timeout;
+ tracker->timeout.tv_sec = p->ts.tv_sec + tracker->host_timeout;
+ tracker->timeout.tv_usec = p->ts.tv_usec;
Frag *prev = NULL, *next;
int overlap = 0;
Address src_addr; /**< Source address for this tracker. */
Address dst_addr; /**< Destination address for this tracker. */
- uint32_t timeout; /**< When this tracker will timeout. */
+ struct timeval timeout; /**< When this tracker will timeout. */
uint32_t host_timeout; /**< Host timeout, statically assigned from the yaml */
/** use cnt, reference counter */