net: sctp: only warn in proc_sctp_do_alpha_beta if write
authorDaniel Borkmann <dborkman@redhat.com>
Mon, 30 Jun 2014 11:52:09 +0000 (13:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Jul 2014 01:44:07 +0000 (18:44 -0700)
Only warn if the value is written to alpha or beta. We don't care
emitting a one-time warning when only reading it.

Reported-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sysctl.c

index 12c7e01c267711ef19878f6c1da1e66e257ecf7e..2e9ada10fd846c10bc6281c30f29cf1fed02ca3c 100644 (file)
@@ -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);
 }