[PATCH 1/2] IPv6: add "disable" module parameter support to ipv6.ko

Previous thread: [PATCH 0/2] Bonding: fix IPv6 module requirement regression by Brian Haley on Tuesday, March 3, 2009 - 7:37 pm. (3 messages)

Next thread: [PATCH 2/2] SCTP: change sctp_ctl_sock_init() to try IPv4 if IPv6 fails by Brian Haley on Tuesday, March 3, 2009 - 7:38 pm. (2 messages)
From: Brian Haley
Date: Tuesday, March 3, 2009 - 7:37 pm

Add "disable" module parameter support to ipv6.ko by specifying
"disable=1" on module load.  We just do the minimum of initializing
inetsw6[] so calls from other modules to inet6_register_protosw()
won't OOPs, then bail out.  No IPv6 addresses or sockets can be
created as a result, and a reboot is required to enable IPv6.


Signed-off-by: Brian Haley <brian.haley@hp.com>
---
  Documentation/networking/ipv6.txt |   35 +++++++++++++++++++++++++++++++++++
  net/ipv6/af_inet6.c               |   22 ++++++++++++++++------
  2 files changed, 51 insertions(+), 6 deletions(-)
  create mode 100644 Documentation/networking/ipv6.txt

diff --git a/Documentation/networking/ipv6.txt b/Documentation/networking/ipv6.txt
new file mode 100644
index 0000000..268e5c1
--- /dev/null
+++ b/Documentation/networking/ipv6.txt
@@ -0,0 +1,35 @@
+
+Options for the ipv6 module are supplied as parameters at load time.
+
+Module options may be given as command line arguments to the insmod
+or modprobe command, but are usually specified in either the
+/etc/modules.conf or /etc/modprobe.conf configuration file, or in a
+distro-specific configuration file.
+
+The available ipv6 module parameters are listed below.  If a parameter
+is not specified the default value is used.
+
+The parameters are as follows:
+
+disable
+
+	Specifies whether to load the IPv6 module, but disable all
+	its functionality.  This might be used when another module
+	has a dependency on the IPv6 module being loaded, but no
+	IPv6 addresses or operations are desired.
+
+	The possible values and their effects are:
+
+	0
+		IPv6 is enabled.
+
+		This is the default value.
+
+	1
+		IPv6 is disabled.
+
+		No IPv6 addresses will be added to interfaces, and
+		it will not be possible to open an IPv6 socket.
+
+		A reboot is required to enable IPv6.
+
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index fa2ac7e..90f6d0c 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -72,6 +72,10 @@ ...
From: David Miller
Date: Wednesday, March 4, 2009 - 4:21 am

From: Brian Haley <brian.haley@hp.com>

Applied, but you have to do something about your email client
and what it does to patches Brian.

Every line that starts with a single space then TABs was
replaced with two space characters then the TABs.  Long
lines were also chopped up.
--

From: Brian Haley
Date: Wednesday, March 4, 2009 - 8:37 am

Sorry, I'll blame it on git-imap-send/tbird :) - I just know how people hate 
attachments, I can play with the settings again.  I'll send it to myself first 
next time and see what gets corrupted, thanks for fixing it up.

I wish we didn't have to do this hack though...

-Brian
--

Previous thread: [PATCH 0/2] Bonding: fix IPv6 module requirement regression by Brian Haley on Tuesday, March 3, 2009 - 7:37 pm. (3 messages)

Next thread: [PATCH 2/2] SCTP: change sctp_ctl_sock_init() to try IPv4 if IPv6 fails by Brian Haley on Tuesday, March 3, 2009 - 7:38 pm. (2 messages)