diff options
author | David S. Miller <davem@davemloft.net> | 2014-07-02 18:44:14 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-02 18:44:14 -0700 |
commit | 239960d66425785affb92d745e3b29e3e9b51745 (patch) | |
tree | 1507ed91bbbaec02273bf493fa13c2d0a383b6be /net | |
parent | eb1ac820c61d0d83747f2575092451efc2be09e4 (diff) | |
parent | eaea2da7286ebc56d557b40ad7e59e715a84e4a0 (diff) | |
download | op-kernel-dev-239960d66425785affb92d745e3b29e3e9b51745.zip op-kernel-dev-239960d66425785affb92d745e3b29e3e9b51745.tar.gz |
Merge branch 'sctp'
Daniel Borkmann says:
====================
Misc SCTP updates
Daniel Borkmann (2):
net: sctp: improve timer slack calculation for transport HBs
net: sctp: only warn in proc_sctp_do_alpha_beta if write
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/sysctl.c | 5 | ||||
-rw-r--r-- | net/sctp/transport.c | 17 |
2 files changed, 12 insertions, 10 deletions
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 12c7e01..2e9ada1 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c @@ -424,8 +424,9 @@ static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - pr_warn_once("Changing rto_alpha or rto_beta may lead to " - "suboptimal rtt/srtt estimations!\n"); + if (write) + pr_warn_once("Changing rto_alpha or rto_beta may lead to " + "suboptimal rtt/srtt estimations!\n"); return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); } diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 7dd672f..b10e047 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -594,15 +594,16 @@ void sctp_transport_burst_reset(struct sctp_transport *t) } /* What is the next timeout value for this transport? */ -unsigned long sctp_transport_timeout(struct sctp_transport *t) +unsigned long sctp_transport_timeout(struct sctp_transport *trans) { - unsigned long timeout; - timeout = t->rto + sctp_jitter(t->rto); - if ((t->state != SCTP_UNCONFIRMED) && - (t->state != SCTP_PF)) - timeout += t->hbinterval; - timeout += jiffies; - return timeout; + /* RTO + timer slack +/- 50% of RTO */ + unsigned long timeout = (trans->rto >> 1) + prandom_u32_max(trans->rto); + + if (trans->state != SCTP_UNCONFIRMED && + trans->state != SCTP_PF) + timeout += trans->hbinterval; + + return timeout + jiffies; } /* Reset transport variables to their initial values */ |