Skip to content

Commit

Permalink
genetlink: add auto module loading
Browse files Browse the repository at this point in the history
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: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Dec 28, 2011
1 parent 7ffbcec commit fa84309
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/netlink/genetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
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;
}

Expand Down

0 comments on commit fa84309

Please sign in to comment.