Commit aec8dc62 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

sock_diag: Fix module netlink aliases

I've made a mistake when fixing the sock_/inet_diag aliases :(

1. The sock_diag layer should request the family-based alias,
   not just the IPPROTO_IP one;
2. The inet_diag layer should request for AF_INET+protocol alias,
   not just the protocol one.

Thus fix this.
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7c466e5
...@@ -64,7 +64,7 @@ static inline struct sock_diag_handler *sock_diag_lock_handler(int family) ...@@ -64,7 +64,7 @@ static inline struct sock_diag_handler *sock_diag_lock_handler(int family)
{ {
if (sock_diag_handlers[family] == NULL) if (sock_diag_handlers[family] == NULL)
request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
NETLINK_SOCK_DIAG, IPPROTO_IP); NETLINK_SOCK_DIAG, family);
mutex_lock(&sock_diag_table_mutex); mutex_lock(&sock_diag_table_mutex);
return sock_diag_handlers[family]; return sock_diag_handlers[family];
...@@ -103,7 +103,7 @@ static int sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -103,7 +103,7 @@ static int sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
case DCCPDIAG_GETSOCK: case DCCPDIAG_GETSOCK:
if (inet_rcv_compat == NULL) if (inet_rcv_compat == NULL)
request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
NETLINK_SOCK_DIAG, IPPROTO_IP); NETLINK_SOCK_DIAG, AF_INET);
mutex_lock(&sock_diag_table_mutex); mutex_lock(&sock_diag_table_mutex);
if (inet_rcv_compat != NULL) if (inet_rcv_compat != NULL)
......
...@@ -83,4 +83,4 @@ module_exit(dccp_diag_fini); ...@@ -83,4 +83,4 @@ module_exit(dccp_diag_fini);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>"); MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
MODULE_DESCRIPTION("DCCP inet_diag handler"); MODULE_DESCRIPTION("DCCP inet_diag handler");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 33); MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-33 /* AF_INET - IPPROTO_DCCP */);
...@@ -54,8 +54,8 @@ static DEFINE_MUTEX(inet_diag_table_mutex); ...@@ -54,8 +54,8 @@ static DEFINE_MUTEX(inet_diag_table_mutex);
static const struct inet_diag_handler *inet_diag_lock_handler(int proto) static const struct inet_diag_handler *inet_diag_lock_handler(int proto)
{ {
if (!inet_diag_table[proto]) if (!inet_diag_table[proto])
request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, request_module("net-pf-%d-proto-%d-type-%d-%d", PF_NETLINK,
NETLINK_SOCK_DIAG, proto); NETLINK_SOCK_DIAG, AF_INET, proto);
mutex_lock(&inet_diag_table_mutex); mutex_lock(&inet_diag_table_mutex);
if (!inet_diag_table[proto]) if (!inet_diag_table[proto])
...@@ -1087,4 +1087,5 @@ static void __exit inet_diag_exit(void) ...@@ -1087,4 +1087,5 @@ static void __exit inet_diag_exit(void)
module_init(inet_diag_init); module_init(inet_diag_init);
module_exit(inet_diag_exit); module_exit(inet_diag_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 0); MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2 /* AF_INET */);
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 10 /* AF_INET6 */);
...@@ -66,4 +66,4 @@ static void __exit tcp_diag_exit(void) ...@@ -66,4 +66,4 @@ static void __exit tcp_diag_exit(void)
module_init(tcp_diag_init); module_init(tcp_diag_init);
module_exit(tcp_diag_exit); module_exit(tcp_diag_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 6); MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-6 /* AF_INET - IPPROTO_TCP */);
...@@ -197,5 +197,5 @@ static void __exit udp_diag_exit(void) ...@@ -197,5 +197,5 @@ static void __exit udp_diag_exit(void)
module_init(udp_diag_init); module_init(udp_diag_init);
module_exit(udp_diag_exit); module_exit(udp_diag_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 17); MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-17 /* AF_INET - IPPROTO_UDP */);
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 136); MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-136 /* AF_INET - IPPROTO_UDPLITE */);
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