Commit fa843095 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

genetlink: add auto module loading

When testing L2TP support, I discovered that the l2tp module is not autoloaded
as are other netlink interfaces. There is because of lack of hook in genetlink to call
request_module and load the module.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ffbcecb
...@@ -792,6 +792,15 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info) ...@@ -792,6 +792,15 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info)
name = nla_data(info->attrs[CTRL_ATTR_FAMILY_NAME]); name = nla_data(info->attrs[CTRL_ATTR_FAMILY_NAME]);
res = genl_family_find_byname(name); res = genl_family_find_byname(name);
#ifdef CONFIG_MODULES
if (res == NULL) {
genl_unlock();
request_module("net-pf-%d-proto-%d-type-%s",
PF_NETLINK, NETLINK_GENERIC, name);
genl_lock();
res = genl_family_find_byname(name);
}
#endif
err = -ENOENT; err = -ENOENT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment