aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pppox.c
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2007-04-30 03:21:02 -0400
committerDavid S. Miller <davem@davemloft.net>2007-04-30 03:21:02 -0400
commit65def812ab25d7565756e5748d91e22e302197ee (patch)
tree597efd0a9a4f155b78d119624556cca129f8a9e9 /drivers/net/pppox.c
parent46f8914e53c28d0716c586e08a7c819d8ebb9d54 (diff)
[L2TP]: Add the ability to autoload a pppox protocol module.
This patch allows a name "pppox-proto-nnn" to be used in modprobe.conf to autoload a PPPoX protocol nnn. Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pppox.c')
-rw-r--r--drivers/net/pppox.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c
index 3f8115db4d54..f3e47d0c2b3c 100644
--- a/drivers/net/pppox.c
+++ b/drivers/net/pppox.c
@@ -31,6 +31,7 @@
31#include <linux/ppp_defs.h> 31#include <linux/ppp_defs.h>
32#include <linux/if_ppp.h> 32#include <linux/if_ppp.h>
33#include <linux/ppp_channel.h> 33#include <linux/ppp_channel.h>
34#include <linux/kmod.h>
34 35
35#include <net/sock.h> 36#include <net/sock.h>
36 37
@@ -114,6 +115,13 @@ static int pppox_create(struct socket *sock, int protocol)
114 goto out; 115 goto out;
115 116
116 rc = -EPROTONOSUPPORT; 117 rc = -EPROTONOSUPPORT;
118#ifdef CONFIG_KMOD
119 if (!pppox_protos[protocol]) {
120 char buffer[32];
121 sprintf(buffer, "pppox-proto-%d", protocol);
122 request_module(buffer);
123 }
124#endif
117 if (!pppox_protos[protocol] || 125 if (!pppox_protos[protocol] ||
118 !try_module_get(pppox_protos[protocol]->owner)) 126 !try_module_get(pppox_protos[protocol]->owner))
119 goto out; 127 goto out;