Skip to content

Commit

Permalink
[L2TP]: Add the ability to autoload a pppox protocol module.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
j-c-h authored and davem330 committed Apr 30, 2007
1 parent 46f8914 commit 65def81
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/pppox.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#include <linux/ppp_channel.h>
#include <linux/kmod.h>

#include <net/sock.h>

Expand Down Expand Up @@ -114,6 +115,13 @@ static int pppox_create(struct socket *sock, int protocol)
goto out;

rc = -EPROTONOSUPPORT;
#ifdef CONFIG_KMOD
if (!pppox_protos[protocol]) {
char buffer[32];
sprintf(buffer, "pppox-proto-%d", protocol);
request_module(buffer);
}
#endif
if (!pppox_protos[protocol] ||
!try_module_get(pppox_protos[protocol]->owner))
goto out;
Expand Down

0 comments on commit 65def81

Please sign in to comment.