Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132142
b: refs/heads/master
c: fe7ca2e
h: refs/heads/master
v: v3
  • Loading branch information
Brian Haley authored and David S. Miller committed Mar 4, 2009
1 parent 6d4893e commit 6f282a1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a8fd2cfdad4d043a1fadba2f3f340945d966825
refs/heads/master: fe7ca2e1e847b65c12d245cbf402af89da96888a
35 changes: 35 additions & 0 deletions trunk/Documentation/networking/ipv6.txt
Original file line number Diff line number Diff line change
@@ -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.

21 changes: 16 additions & 5 deletions trunk/net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ MODULE_LICENSE("GPL");
static struct list_head inetsw6[SOCK_MAX];
static DEFINE_SPINLOCK(inetsw6_lock);

static int disable_ipv6 = 0;
module_param_named(disable, disable_ipv6, int, 0);
MODULE_PARM_DESC(disable, "Disable IPv6 such that it is non-functional");

static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
{
const int offset = sk->sk_prot->obj_size - sizeof(struct ipv6_pinfo);
Expand Down Expand Up @@ -991,10 +995,21 @@ static int __init inet6_init(void)
{
struct sk_buff *dummy_skb;
struct list_head *r;
int err;
int err = 0;

BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));

/* Register the socket-side information for inet6_create. */
for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
INIT_LIST_HEAD(r);

if (disable_ipv6) {
printk(KERN_INFO
"IPv6: Loaded, but administratively disabled, "
"reboot required to enable\n");
goto out;
}

err = proto_register(&tcpv6_prot, 1);
if (err)
goto out;
Expand All @@ -1012,10 +1027,6 @@ static int __init inet6_init(void)
goto out_unregister_udplite_proto;


/* Register the socket-side information for inet6_create. */
for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
INIT_LIST_HEAD(r);

/* We MUST register RAW sockets before we create the ICMP6,
* IGMP6, or NDISC control sockets.
*/
Expand Down

0 comments on commit 6f282a1

Please sign in to comment.