Skip to contentSkip to conversation

l2tp: pppox protocol module load

PATCH Applied James Chapman 2 participants 2 messages Apr 23, 2007 – Apr 30, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/5 l2tp: pppox protocol module load

[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.

drivers/net/pppox.c +7 -0
Index: linux-2.6.21-rc7/drivers/net/pppox.c
===================================================================
@@ -114,6 +114,13 @@ static int pppox_create(struct socket *s
 		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;
maintainer
#1 lore raw

From: James Chapman <[email protected]>
Date: Mon, 23 Apr 2007 17:01:03 +0100

Quoted 15 lines

[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.

Index: linux-2.6.21-rc7/drivers/net/pppox.c
===================================================================

drivers/net/pppox.c +0 -0
@@ -114,6 +114,13 @@ static int pppox_create(struct socket *s
 		goto out;
 
 	rc = -EPROTONOSUPPORT;

drivers/net/pppox.c static int pppox_create(struct socket *s · line 126

Quoted 10 lines
drivers/net/pppox.c +7 -0
+#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;

If you're going to use an interface declared in linux/kmod.h you'll have to make sure that header file is included by pppox.c

I've made that fix and applied your patch, thanks.