Bugfix: Don't send HBs on path which are not idle.

MFC after: 1 week
This commit is contained in:
Michael Tuexen 2012-04-14 20:22:01 +00:00
parent 83a8745245
commit ca7567c923
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234296

View File

@ -1438,7 +1438,22 @@ sctp_heartbeat_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
* when move to PF during threshold mangement, a HB has been
* queued in that routine
*/
sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
uint32_t ms_gone_by;
if ((net->last_sent_time.tv_sec > 0) ||
(net->last_sent_time.tv_usec > 0)) {
struct timeval diff;
SCTP_GETTIME_TIMEVAL(&diff);
timevalsub(&diff, &net->last_sent_time);
ms_gone_by = (uint32_t) (diff.tv_sec * 1000) +
(uint32_t) (diff.tv_usec / 1000);
} else {
ms_gone_by = 0xffffffff;
}
if (ms_gone_by >= net->heart_beat_delay) {
sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
}
}
return (0);
}