Commit 146b6f89 authored by Jon Grimm's avatar Jon Grimm

[SCTP] sctp_jitter() needs to protect against div by 0.

User can configure rto_initial to zero... we go boom.
parent 5308e103
......@@ -417,6 +417,10 @@ static inline __s32 sctp_jitter(__u32 rto)
static __u32 sctp_rand;
__s32 ret;
/* Avoid divide by zero. */
if (!rto)
rto = 1;
sctp_rand += jiffies;
sctp_rand ^= (sctp_rand << 12);
sctp_rand ^= (sctp_rand >> 20);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment