summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2012-04-14 20:22:01 +0000
committertuexen <tuexen@FreeBSD.org>2012-04-14 20:22:01 +0000
commitbc585f510348f49398c0f4847169f7fd74b5d3d4 (patch)
tree71b19871d94243eed4e53718a5ad9cf9fd9880af
parent330283063f351c3bbd9c54affbe2ea60afc76f5c (diff)
downloadFreeBSD-src-bc585f510348f49398c0f4847169f7fd74b5d3d4.zip
FreeBSD-src-bc585f510348f49398c0f4847169f7fd74b5d3d4.tar.gz
Bugfix: Don't send HBs on path which are not idle.
MFC after: 1 week
-rw-r--r--sys/netinet/sctp_timer.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index f347105..8d7abca 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -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);
}
OpenPOWER on IntegriCloud