vrf: fix a kernel warning
[cascardo/linux.git] / net / l2tp / l2tp_netlink.c
index 9e13c2f..f93c5be 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;