diff options
author | David S. Miller <davem@davemloft.net> | 2014-07-02 21:44:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-02 21:44:14 -0400 |
commit | 239960d66425785affb92d745e3b29e3e9b51745 (patch) | |
tree | 1507ed91bbbaec02273bf493fa13c2d0a383b6be /net | |
parent | eb1ac820c61d0d83747f2575092451efc2be09e4 (diff) | |
parent | eaea2da7286ebc56d557b40ad7e59e715a84e4a0 (diff) |
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 12c7e01c2677..2e9ada10fd84 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, | |||
424 | void __user *buffer, size_t *lenp, | 424 | void __user *buffer, size_t *lenp, |
425 | loff_t *ppos) | 425 | loff_t *ppos) |
426 | { | 426 | { |
427 | pr_warn_once("Changing rto_alpha or rto_beta may lead to " | 427 | if (write) |
428 | "suboptimal rtt/srtt estimations!\n"); | 428 | pr_warn_once("Changing rto_alpha or rto_beta may lead to " |
429 | "suboptimal rtt/srtt estimations!\n"); | ||
429 | 430 | ||
430 | return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); | 431 | return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); |
431 | } | 432 | } |
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 7dd672fa651f..b10e047bbd15 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
@@ -594,15 +594,16 @@ void sctp_transport_burst_reset(struct sctp_transport *t) | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /* What is the next timeout value for this transport? */ | 596 | /* What is the next timeout value for this transport? */ |
597 | unsigned long sctp_transport_timeout(struct sctp_transport *t) | 597 | unsigned long sctp_transport_timeout(struct sctp_transport *trans) |
598 | { | 598 | { |
599 | unsigned long timeout; | 599 | /* RTO + timer slack +/- 50% of RTO */ |
600 | timeout = t->rto + sctp_jitter(t->rto); | 600 | unsigned long timeout = (trans->rto >> 1) + prandom_u32_max(trans->rto); |
601 | if ((t->state != SCTP_UNCONFIRMED) && | 601 | |
602 | (t->state != SCTP_PF)) | 602 | if (trans->state != SCTP_UNCONFIRMED && |
603 | timeout += t->hbinterval; | 603 | trans->state != SCTP_PF) |
604 | timeout += jiffies; | 604 | timeout += trans->hbinterval; |
605 | return timeout; | 605 | |
606 | return timeout + jiffies; | ||
606 | } | 607 | } |
607 | 608 | ||
608 | /* Reset transport variables to their initial values */ | 609 | /* Reset transport variables to their initial values */ |