netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
	Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: [RFC PATCH net-next 5/7] net: ipv6: mld: restrict min/max of sysctl force_mld_version
Date: Fri, 30 Aug 2013 18:58:26 +0200	[thread overview]
Message-ID: <1377881908-8022-6-git-send-email-dborkman@redhat.com> (raw)
In-Reply-To: <1377881908-8022-1-git-send-email-dborkman@redhat.com>

Restrict minimum and maximum values that are allowed to be set by the
administrator for force_mld_version into sysctl:

  0 - No enforcement of any MLD version
  1 - Enforce to use MLD version 1
  2 - Enforce to use MLD version 2

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/addrconf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index a7183fc..dde76d4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -106,6 +106,9 @@
 
 #define	INFINITY_LIFE_TIME	0xFFFFFFFF
 
+static int zero = 0;
+static int two = 2;
+
 static inline u32 cstamp_delta(unsigned long cstamp)
 {
 	return (cstamp - INITIAL_JIFFIES) * 100UL / HZ;
@@ -4842,7 +4845,9 @@ static struct addrconf_sysctl_table
 			.data		= &ipv6_devconf.force_mld_version,
 			.maxlen		= sizeof(int),
 			.mode		= 0644,
-			.proc_handler	= proc_dointvec,
+			.proc_handler	= proc_dointvec_minmax,
+			.extra1		= &zero,
+			.extra2		= &two,
 		},
 		{
 			.procname	= "mldv1_unsolicited_report_interval",
-- 
1.7.11.7

  parent reply	other threads:[~2013-08-30 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30 16:58 [RFC PATCH net-next 0/7] IPv6 MLD updates Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 1/7] net: ipv6: mld: fix v1/v2 switchback timeout to rfc3810, 9.12 Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 2/7] net: ipv6: mld: clean up MLD_V1_SEEN macro Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 3/7] net: ipv6: mld: get rid of MLDV2_MRC and simplify calculation Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 4/7] net: ipv6: mld: implement RFC3810 MLDv2 mode only Daniel Borkmann
2013-08-30 16:58 ` Daniel Borkmann [this message]
2013-08-30 16:58 ` [RFC PATCH net-next 6/7] net: ipv6: mld: similarly to MLDv2 have min max_delay of 1 Daniel Borkmann
2013-08-30 16:58 ` [RFC PATCH net-next 7/7] net: ipv6: mld: document force_mld_version in ip-sysctl.txt Daniel Borkmann
2013-08-30 18:38 ` [RFC PATCH net-next 0/7] IPv6 MLD updates David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377881908-8022-6-git-send-email-dborkman@redhat.com \
    --to=dborkman@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).