Merge tag 'clk-for-linus-20151104' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / net / l2tp / l2tp_netlink.c
index 9e13c2ff878970fbbe355990f756684d9e868988..f93c5be612a7cb43611708ebb66c25b4db0d27cf 100644 (file)
@@ -576,6 +576,13 @@ static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *inf
        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;