svn commit: r234808 - stable/8/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Sun Apr 29 18:40:41 UTC 2012
Author: tuexen
Date: Sun Apr 29 18:40:41 2012
New Revision: 234808
URL: http://svn.freebsd.org/changeset/base/234808
Log:
MFC r234296,r234297:
Bugfix: Don't send HBs on path which are not idle.
Send always HBs when in PF state.
Modified:
stable/8/sys/netinet/sctp_timer.c
Directory Properties:
stable/8/sys/ (props changed)
Modified: stable/8/sys/netinet/sctp_timer.c
==============================================================================
--- stable/8/sys/netinet/sctp_timer.c Sun Apr 29 18:37:26 2012 (r234807)
+++ stable/8/sys/netinet/sctp_timer.c Sun Apr 29 18:40:41 2012 (r234808)
@@ -1438,7 +1438,23 @@ sctp_heartbeat_timer(struct sctp_inpcb *
* 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) ||
+ (net->dest_state & SCTP_ADDR_PF)) {
+ sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
+ }
}
return (0);
}
More information about the svn-src-stable-8
mailing list