genetlink: add auto module loading
Subsystems (2)
PATCH 1/1 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.
net/netlink/genetlink.c +9 -0
@@ -792,6 +792,15 @@ static int ctrl_getfamily(struct sk_buff 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 ; }
From: Stephen Hemminger <[email protected]>
Date: Wed, 28 Dec 2011 10:19:58 -0800
Quoted 5 lines
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_moduleand load the module.Signed-off-by Stephen Hemminger <[email protected]>
Applied, but for completeness we should probably also handle the "by ID" case right above this code block too.
Could you please submit a patch for that?
Thanks.
Quoted 7 lines · On Wed, 28 Dec 2011 13:49:39 -0500 (EST) David Miller <[email protected]>…
From: Stephen Hemminger <[email protected]>
Date: Wed, 28 Dec 2011 10:19:58 -0800Quoted 4 lines
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_moduleand load the module.
Quoted 8 lines
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>Applied, but for completeness we should probably also handle the "by ID" case right above this code block too.
Could you please submit a patch for that?
Thanks.
There is no point really. All the existing drivers,
use GENL_ID_GENERATE which generates the ID when they are loaded. Chicken and egg principle.
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Wed, 28 Dec 2011 11:02:08 -0800
Quoted 15 lines
Quoted 12 lines · On Wed, 28 Dec 2011 13:49:39 -0500 (EST) David Miller <[email protected]>…
From: Stephen Hemminger <[email protected]>
Date: Wed, 28 Dec 2011 10:19:58 -0800Quoted 5 lines
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_moduleand load the module.Signed-off-by Stephen Hemminger <[email protected]>Applied, but for completeness we should probably also handle the "by ID" case right above this code block too.
Quoted 7 lines
Quoted 3 lines
Could you please submit a patch for that?
Thanks.
There is no point really. All the existing drivers,
useGENL_ID_GENERATEwhich generates the ID when they are loaded. Chicken and egg principle.
Ok, then I wonder why we support ID based lookups at all.