diff options
Diffstat (limited to 'net/sctp')
| -rw-r--r-- | net/sctp/sysctl.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 7e5eb7554990..dcb19592761e 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c | |||
| @@ -34,6 +34,8 @@ | |||
| 34 | * Sridhar Samudrala <sri@us.ibm.com> | 34 | * Sridhar Samudrala <sri@us.ibm.com> |
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 38 | |||
| 37 | #include <net/sctp/structs.h> | 39 | #include <net/sctp/structs.h> |
| 38 | #include <net/sctp/sctp.h> | 40 | #include <net/sctp/sctp.h> |
| 39 | #include <linux/sysctl.h> | 41 | #include <linux/sysctl.h> |
| @@ -46,6 +48,11 @@ static int sack_timer_min = 1; | |||
| 46 | static int sack_timer_max = 500; | 48 | static int sack_timer_max = 500; |
| 47 | static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ | 49 | static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ |
| 48 | static int rwnd_scale_max = 16; | 50 | static int rwnd_scale_max = 16; |
| 51 | static int rto_alpha_min = 0; | ||
| 52 | static int rto_beta_min = 0; | ||
| 53 | static int rto_alpha_max = 1000; | ||
| 54 | static int rto_beta_max = 1000; | ||
| 55 | |||
| 49 | static unsigned long max_autoclose_min = 0; | 56 | static unsigned long max_autoclose_min = 0; |
| 50 | static unsigned long max_autoclose_max = | 57 | static unsigned long max_autoclose_max = |
| 51 | (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX) | 58 | (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX) |
| @@ -64,6 +71,9 @@ static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write, | |||
| 64 | static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, | 71 | static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, |
| 65 | void __user *buffer, size_t *lenp, | 72 | void __user *buffer, size_t *lenp, |
| 66 | loff_t *ppos); | 73 | loff_t *ppos); |
| 74 | static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, | ||
| 75 | void __user *buffer, size_t *lenp, | ||
| 76 | loff_t *ppos); | ||
| 67 | static int proc_sctp_do_auth(struct ctl_table *ctl, int write, | 77 | static int proc_sctp_do_auth(struct ctl_table *ctl, int write, |
| 68 | void __user *buffer, size_t *lenp, | 78 | void __user *buffer, size_t *lenp, |
| 69 | loff_t *ppos); | 79 | loff_t *ppos); |
| @@ -126,15 +136,19 @@ static struct ctl_table sctp_net_table[] = { | |||
| 126 | .procname = "rto_alpha_exp_divisor", | 136 | .procname = "rto_alpha_exp_divisor", |
| 127 | .data = &init_net.sctp.rto_alpha, | 137 | .data = &init_net.sctp.rto_alpha, |
| 128 | .maxlen = sizeof(int), | 138 | .maxlen = sizeof(int), |
| 129 | .mode = 0444, | 139 | .mode = 0644, |
| 130 | .proc_handler = proc_dointvec, | 140 | .proc_handler = proc_sctp_do_alpha_beta, |
| 141 | .extra1 = &rto_alpha_min, | ||
| 142 | .extra2 = &rto_alpha_max, | ||
| 131 | }, | 143 | }, |
| 132 | { | 144 | { |
| 133 | .procname = "rto_beta_exp_divisor", | 145 | .procname = "rto_beta_exp_divisor", |
| 134 | .data = &init_net.sctp.rto_beta, | 146 | .data = &init_net.sctp.rto_beta, |
| 135 | .maxlen = sizeof(int), | 147 | .maxlen = sizeof(int), |
| 136 | .mode = 0444, | 148 | .mode = 0644, |
| 137 | .proc_handler = proc_dointvec, | 149 | .proc_handler = proc_sctp_do_alpha_beta, |
| 150 | .extra1 = &rto_beta_min, | ||
| 151 | .extra2 = &rto_beta_max, | ||
| 138 | }, | 152 | }, |
| 139 | { | 153 | { |
| 140 | .procname = "max_burst", | 154 | .procname = "max_burst", |
| @@ -403,6 +417,16 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, | |||
| 403 | return ret; | 417 | return ret; |
| 404 | } | 418 | } |
| 405 | 419 | ||
| 420 | static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, | ||
| 421 | void __user *buffer, size_t *lenp, | ||
| 422 | loff_t *ppos) | ||
| 423 | { | ||
| 424 | pr_warn_once("Changing rto_alpha or rto_beta may lead to " | ||
| 425 | "suboptimal rtt/srtt estimations!\n"); | ||
| 426 | |||
| 427 | return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); | ||
| 428 | } | ||
| 429 | |||
| 406 | static int proc_sctp_do_auth(struct ctl_table *ctl, int write, | 430 | static int proc_sctp_do_auth(struct ctl_table *ctl, int write, |
| 407 | void __user *buffer, size_t *lenp, | 431 | void __user *buffer, size_t *lenp, |
| 408 | loff_t *ppos) | 432 | loff_t *ppos) |
