From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 20:22:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 373CB1065670; Sat, 14 Apr 2012 20:22:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2221B8FC0A; Sat, 14 Apr 2012 20:22:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EKM1Pr045640; Sat, 14 Apr 2012 20:22:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EKM1Us045638; Sat, 14 Apr 2012 20:22:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201204142022.q3EKM1Us045638@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Apr 2012 20:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234296 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 20:22:02 -0000 Author: tuexen Date: Sat Apr 14 20:22:01 2012 New Revision: 234296 URL: http://svn.freebsd.org/changeset/base/234296 Log: Bugfix: Don't send HBs on path which are not idle. MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sat Apr 14 17:35:59 2012 (r234295) +++ head/sys/netinet/sctp_timer.c Sat Apr 14 20:22:01 2012 (r234296) @@ -1438,7 +1438,22 @@ 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) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } return (0); }