* [PATCH net-next 0/3] l2tp: module autoloading
@ 2015-09-24 4:33 Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 1/3] l2tp: auto load type modules Stephen Hemminger
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-09-24 4:33 UTC (permalink / raw)
To: jchapman, davem; +Cc: netdev
With L2TP it was necessary to manually load modules
which is a nuisance and not required with other tunneling
protocols. This set of patches adds the aliases and module
load hook to get rid of the necessity of modprobing.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/3] l2tp: auto load type modules
2015-09-24 4:33 [PATCH net-next 0/3] l2tp: module autoloading Stephen Hemminger
@ 2015-09-24 4:33 ` Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 2/3] l2tp: auto load IP modules Stephen Hemminger
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-09-24 4:33 UTC (permalink / raw)
To: jchapman, davem; +Cc: netdev, Stephen Hemminger
[-- Attachment #1: l2tp-eth-alias.patch --]
[-- Type: text/plain, Size: 1979 bytes --]
It should not be necessary to do explicit module loading when
configuring L2TP. Modules should be loaded as needed instead
(as is done already with netlink and other tunnel types).
This patch adds a new module alias type and code to load
the sub module on demand.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/l2tp/l2tp_core.h 2015-09-23 21:23:43.324539500 -0700
+++ b/net/l2tp/l2tp_core.h 2015-09-23 21:27:36.049615188 -0700
@@ -321,4 +321,7 @@ do { \
#define l2tp_dbg(ptr, type, fmt, ...) \
l2tp_printk(ptr, type, pr_debug, fmt, ##__VA_ARGS__)
+#define MODULE_ALIAS_L2TP_PWTYPE(type) \
+ MODULE_ALIAS("net-l2tp-type-" __stringify(type))
+
#endif /* _L2TP_CORE_H_ */
--- a/net/l2tp/l2tp_eth.c 2015-09-23 21:23:43.324539500 -0700
+++ b/net/l2tp/l2tp_eth.c 2015-09-23 21:23:43.320539481 -0700
@@ -358,3 +358,4 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
MODULE_DESCRIPTION("L2TP ethernet pseudowire driver");
MODULE_VERSION("1.0");
+MODULE_ALIAS_L2TP_PWTYPE(5);
--- a/net/l2tp/l2tp_netlink.c 2015-09-23 21:23:43.324539500 -0700
+++ b/net/l2tp/l2tp_netlink.c 2015-09-23 21:27:47.033665958 -0700
@@ -576,6 +576,13 @@ static int l2tp_nl_cmd_session_create(st
if (info->attrs[L2TP_ATTR_MRU])
cfg.mru = nla_get_u16(info->attrs[L2TP_ATTR_MRU]);
+#ifdef CONFIG_MODULES
+ if (l2tp_nl_cmd_ops[cfg.pw_type] == NULL) {
+ genl_unlock();
+ request_module("net-l2tp-type-%u", cfg.pw_type);
+ genl_lock();
+ }
+#endif
if ((l2tp_nl_cmd_ops[cfg.pw_type] == NULL) ||
(l2tp_nl_cmd_ops[cfg.pw_type]->session_create == NULL)) {
ret = -EPROTONOSUPPORT;
--- a/net/l2tp/l2tp_ppp.c 2015-09-23 21:23:43.324539500 -0700
+++ b/net/l2tp/l2tp_ppp.c 2015-09-23 21:23:43.320539481 -0700
@@ -1863,3 +1863,4 @@ MODULE_DESCRIPTION("PPP over L2TP over U
MODULE_LICENSE("GPL");
MODULE_VERSION(PPPOL2TP_DRV_VERSION);
MODULE_ALIAS("pppox-proto-" __stringify(PX_PROTO_OL2TP));
+MODULE_ALIAS_L2TP_PWTYPE(11);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 2/3] l2tp: auto load IP modules
2015-09-24 4:33 [PATCH net-next 0/3] l2tp: module autoloading Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 1/3] l2tp: auto load type modules Stephen Hemminger
@ 2015-09-24 4:33 ` Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 3/3] l2tp: remove references to modprobe in documentation Stephen Hemminger
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-09-24 4:33 UTC (permalink / raw)
To: jchapman, davem; +Cc: netdev, Stephen Hemminger
[-- Attachment #1: l2tp-ip-alias.patch --]
[-- Type: text/plain, Size: 813 bytes --]
When creating a IP encapsulated tunnel the necessary l2tp module
should be loaded. It already works for UDP encapsulation, it just
doesn't work for direct IP encap.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/l2tp/l2tp_ip.c 2015-09-23 21:24:08.644656533 -0700
+++ b/net/l2tp/l2tp_ip.c 2015-09-23 21:24:08.640656514 -0700
@@ -655,3 +655,4 @@ MODULE_VERSION("1.0");
* enums
*/
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
--- a/net/l2tp/l2tp_ip6.c 2015-09-23 21:24:08.644656533 -0700
+++ b/net/l2tp/l2tp_ip6.c 2015-09-23 21:24:08.640656514 -0700
@@ -801,3 +801,4 @@ MODULE_VERSION("1.0");
* enums
*/
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 3/3] l2tp: remove references to modprobe in documentation
2015-09-24 4:33 [PATCH net-next 0/3] l2tp: module autoloading Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 1/3] l2tp: auto load type modules Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 2/3] l2tp: auto load IP modules Stephen Hemminger
@ 2015-09-24 4:33 ` Stephen Hemminger
2015-09-24 6:45 ` [PATCH net-next 0/3] l2tp: module autoloading James Chapman
2015-09-25 19:28 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2015-09-24 4:33 UTC (permalink / raw)
To: jchapman, davem; +Cc: netdev, Stephen Hemminger
[-- Attachment #1: l2tp-doc-modprobe.patch --]
[-- Type: text/plain, Size: 1018 bytes --]
No longer need explicit modprobe's and update to use ip instead
of deprecated ifconfig command.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/Documentation/networking/l2tp.txt 2015-05-21 15:13:01.421115881 -0700
+++ b/Documentation/networking/l2tp.txt 2015-09-07 12:18:07.672921513 -0700
@@ -213,15 +213,12 @@ To create an L2TPv3 ethernet pseudowire
and peer 192.168.1.2, using IP addresses 10.5.1.1 and 10.5.1.2 for the
tunnel endpoints:-
-# modprobe l2tp_eth
-# modprobe l2tp_netlink
-
# ip l2tp add tunnel tunnel_id 1 peer_tunnel_id 1 udp_sport 5000 \
udp_dport 5000 encap udp local 192.168.1.1 remote 192.168.1.2
# ip l2tp add session tunnel_id 1 session_id 1 peer_session_id 1
-# ifconfig -a
+# ip -s -d show dev l2tpeth0
# ip addr add 10.5.1.2/32 peer 10.5.1.1/32 dev l2tpeth0
-# ifconfig l2tpeth0 up
+# ip li set dev l2tpeth0 up
Choose IP addresses to be the address of a local IP interface and that
of the remote system. The IP addresses of the l2tpeth0 interface can be
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/3] l2tp: module autoloading
2015-09-24 4:33 [PATCH net-next 0/3] l2tp: module autoloading Stephen Hemminger
` (2 preceding siblings ...)
2015-09-24 4:33 ` [PATCH net-next 3/3] l2tp: remove references to modprobe in documentation Stephen Hemminger
@ 2015-09-24 6:45 ` James Chapman
2015-09-25 19:28 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: James Chapman @ 2015-09-24 6:45 UTC (permalink / raw)
To: Stephen Hemminger, davem; +Cc: netdev
On 24/09/15 05:33, Stephen Hemminger wrote:
> With L2TP it was necessary to manually load modules
> which is a nuisance and not required with other tunneling
> protocols. This set of patches adds the aliases and module
> load hook to get rid of the necessity of modprobing.
Looks good.
Acked-By: James Chapman <jchapman@katalix.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/3] l2tp: module autoloading
2015-09-24 4:33 [PATCH net-next 0/3] l2tp: module autoloading Stephen Hemminger
` (3 preceding siblings ...)
2015-09-24 6:45 ` [PATCH net-next 0/3] l2tp: module autoloading James Chapman
@ 2015-09-25 19:28 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2015-09-25 19:28 UTC (permalink / raw)
To: stephen; +Cc: jchapman, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 23 Sep 2015 21:33:33 -0700
> With L2TP it was necessary to manually load modules
> which is a nuisance and not required with other tunneling
> protocols. This set of patches adds the aliases and module
> load hook to get rid of the necessity of modprobing.
Series applied, thanks Stephen.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-25 19:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-24 4:33 [PATCH net-next 0/3] l2tp: module autoloading Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 1/3] l2tp: auto load type modules Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 2/3] l2tp: auto load IP modules Stephen Hemminger
2015-09-24 4:33 ` [PATCH net-next 3/3] l2tp: remove references to modprobe in documentation Stephen Hemminger
2015-09-24 6:45 ` [PATCH net-next 0/3] l2tp: module autoloading James Chapman
2015-09-25 19:28 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.