diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-12-28 13:48:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-28 13:48:55 -0500 |
commit | fa84309533025eb3f03dc1d2d2be1c3ca206882a (patch) | |
tree | d023095d481cb331e8cfc569de18ea89a04eb7fd | |
parent | 7ffbcecbeed91e5874e9a1cfc4c0cbb07dac3069 (diff) |
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: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/netlink/genetlink.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 21a82410ec7c..a403b618faa5 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -792,6 +792,15 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info) | |||
792 | 792 | ||
793 | name = nla_data(info->attrs[CTRL_ATTR_FAMILY_NAME]); | 793 | name = nla_data(info->attrs[CTRL_ATTR_FAMILY_NAME]); |
794 | res = genl_family_find_byname(name); | 794 | res = genl_family_find_byname(name); |
795 | #ifdef CONFIG_MODULES | ||
796 | if (res == NULL) { | ||
797 | genl_unlock(); | ||
798 | request_module("net-pf-%d-proto-%d-type-%s", | ||
799 | PF_NETLINK, NETLINK_GENERIC, name); | ||
800 | genl_lock(); | ||
801 | res = genl_family_find_byname(name); | ||
802 | } | ||
803 | #endif | ||
795 | err = -ENOENT; | 804 | err = -ENOENT; |
796 | } | 805 | } |
797 | 806 | ||