From e9412c37082b5c932e83364aaed0c38c2ce33acb Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Tue, 29 May 2012 09:30:41 +0000 Subject: genetlink: Build a generic netlink family module alias Generic netlink searches for -type- formatted aliases when requesting a module to fulfill a protocol request (i.e. net-pf-16-proto-16-type-, where x is a type value). However generic netlink protocols have no well defined type numbers, they have string names. Modify genl_ctrl_getfamily to request an alias in the format net-pf-16-proto-16-family- instead, where x is a generic string, and add a macro that builds on the previously added MODULE_ALIAS_NET_PF_PROTO_NAME macro to allow modules to specifify those generic strings. Note, l2tp previously hacked together an net-pf-16-proto-16-type-l2tp alias using the MODULE_ALIAS macro, with these updates we can convert that to use the PROTO_NAME macro. Signed-off-by: Neil Horman CC: Eric Dumazet CC: James Chapman CC: David Miller Signed-off-by: David S. Miller --- include/linux/genetlink.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/genetlink.h') diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 73c28dea10ae..7a114016ac7d 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h @@ -110,6 +110,9 @@ extern int lockdep_genl_is_held(void); #define genl_dereference(p) \ rcu_dereference_protected(p, lockdep_genl_is_held()) +#define MODULE_ALIAS_GENL_FAMILY(family)\ + MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family) + #endif /* __KERNEL__ */ #endif /* __LINUX_GENERIC_NETLINK_H */ -- cgit