aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2021-03-22 15:40:41 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2021-03-22 15:44:18 +0000
commitd995cc7e5431873b839269fe22577acfa3b157bd (patch)
tree9c3ab7b2c07f3b9607f229d91ed8c2ef0a96e7ce
parent048488c0c4e47aa2aac9709b18d7da14b06f78cd (diff)
downloadsrc-d995cc7e5431873b839269fe22577acfa3b157bd.tar.gz
src-d995cc7e5431873b839269fe22577acfa3b157bd.zip
sctp: fix handling of RTO.initial of 1 ms
MFC after: 3 days Reported by: syzbot+5eb0e009147050056ce9@syzkaller.appspotmail.com
-rw-r--r--sys/netinet/sctputil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 7ddb4c3710df..5d4b3347a2c9 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -2277,7 +2277,9 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
}
rndval = sctp_select_initial_TSN(&inp->sctp_ep);
jitter = rndval % to_ticks;
- to_ticks >>= 1;
+ if (to_ticks > 1) {
+ to_ticks >>= 1;
+ }
if (jitter < (UINT32_MAX - to_ticks)) {
to_ticks += jitter;
} else {