If the retransmit timeout was more than a second we could end up
generating a timeout that was both invalid (tv_nsec >= 1e9) and too
large.
static void timespec_clear(struct timespec *a) {
a->tv_sec = 0;
+ a->tv_nsec = 0;
}
static bool timespec_isset(const struct timespec *a) {
rto -= USEC_PER_SEC;
}
- c->rtrx_timeout.tv_nsec += c->rto * 1000;
+ c->rtrx_timeout.tv_nsec += rto * 1000;
if(c->rtrx_timeout.tv_nsec >= NSEC_PER_SEC) {
c->rtrx_timeout.tv_nsec -= NSEC_PER_SEC;