Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65def812 authored by James Chapman's avatar James Chapman Committed by David S. Miller
Browse files

[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: default avatarJames Chapman <jchapman@katalix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 46f8914e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;