mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
[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>
This commit is contained in:
parent
46f8914e53
commit
65def812ab
1 changed files with 8 additions and 0 deletions
|
@ -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>
|
||||
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue