Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2020 22:00:35 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r362877 - stable/12/sys/netinet
Message-ID:  <202007012200.061M0ZE9033361@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Wed Jul  1 22:00:35 2020
New Revision: 362877
URL: https://svnweb.freebsd.org/changeset/base/362877

Log:
  MFC r356660:
  Fix division by zero issue.
  
  Thanks to Stas Denisov for reporting the issue for the userland stack
  and providing a fix.

Modified:
  stable/12/sys/netinet/sctp_cc_functions.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_cc_functions.c
==============================================================================
--- stable/12/sys/netinet/sctp_cc_functions.c	Wed Jul  1 21:59:18 2020	(r362876)
+++ stable/12/sys/netinet/sctp_cc_functions.c	Wed Jul  1 22:00:35 2020	(r362877)
@@ -1876,7 +1876,7 @@ htcp_cong_time(struct htcp *ca)
 static inline uint32_t
 htcp_ccount(struct htcp *ca)
 {
-	return (htcp_cong_time(ca) / ca->minRTT);
+	return (ca->minRTT == 0 ? htcp_cong_time(ca) : htcp_cong_time(ca) / ca->minRTT);
 }
 
 static inline void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007012200.061M0ZE9033361>