diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2011-12-14 21:43:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-16 13:48:27 -0500 |
commit | aec8dc62f66199aef153d86e1f90d9c1d14696e3 (patch) | |
tree | bdf927f62708cfa5b7a0561725ab76da8ac2ceb2 | |
parent | e7c466e58eb1ff9bf49c2f3902622dc11a8c7022 (diff) |
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: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/sock_diag.c | 4 | ||||
-rw-r--r-- | net/dccp/diag.c | 2 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_diag.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp_diag.c | 4 |
5 files changed, 10 insertions, 9 deletions
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index 9c27bcda59be..cee96f368108 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c | |||
@@ -64,7 +64,7 @@ static inline struct sock_diag_handler *sock_diag_lock_handler(int family) | |||
64 | { | 64 | { |
65 | if (sock_diag_handlers[family] == NULL) | 65 | if (sock_diag_handlers[family] == NULL) |
66 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, | 66 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, |
67 | NETLINK_SOCK_DIAG, IPPROTO_IP); | 67 | NETLINK_SOCK_DIAG, family); |
68 | 68 | ||
69 | mutex_lock(&sock_diag_table_mutex); | 69 | mutex_lock(&sock_diag_table_mutex); |
70 | return sock_diag_handlers[family]; | 70 | return sock_diag_handlers[family]; |
@@ -103,7 +103,7 @@ static int sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
103 | case DCCPDIAG_GETSOCK: | 103 | case DCCPDIAG_GETSOCK: |
104 | if (inet_rcv_compat == NULL) | 104 | if (inet_rcv_compat == NULL) |
105 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, | 105 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, |
106 | NETLINK_SOCK_DIAG, IPPROTO_IP); | 106 | NETLINK_SOCK_DIAG, AF_INET); |
107 | 107 | ||
108 | mutex_lock(&sock_diag_table_mutex); | 108 | mutex_lock(&sock_diag_table_mutex); |
109 | if (inet_rcv_compat != NULL) | 109 | if (inet_rcv_compat != NULL) |
diff --git a/net/dccp/diag.c b/net/dccp/diag.c index e29214d193d6..8f1625753377 100644 --- a/net/dccp/diag.c +++ b/net/dccp/diag.c | |||
@@ -83,4 +83,4 @@ module_exit(dccp_diag_fini); | |||
83 | MODULE_LICENSE("GPL"); | 83 | MODULE_LICENSE("GPL"); |
84 | MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>"); | 84 | MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>"); |
85 | MODULE_DESCRIPTION("DCCP inet_diag handler"); | 85 | MODULE_DESCRIPTION("DCCP inet_diag handler"); |
86 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 33); | 86 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-33 /* AF_INET - IPPROTO_DCCP */); |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 575e28c57cc9..fa27313765f3 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -54,8 +54,8 @@ static DEFINE_MUTEX(inet_diag_table_mutex); | |||
54 | static const struct inet_diag_handler *inet_diag_lock_handler(int proto) | 54 | static const struct inet_diag_handler *inet_diag_lock_handler(int proto) |
55 | { | 55 | { |
56 | if (!inet_diag_table[proto]) | 56 | if (!inet_diag_table[proto]) |
57 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, | 57 | request_module("net-pf-%d-proto-%d-type-%d-%d", PF_NETLINK, |
58 | NETLINK_SOCK_DIAG, proto); | 58 | NETLINK_SOCK_DIAG, AF_INET, proto); |
59 | 59 | ||
60 | mutex_lock(&inet_diag_table_mutex); | 60 | mutex_lock(&inet_diag_table_mutex); |
61 | if (!inet_diag_table[proto]) | 61 | if (!inet_diag_table[proto]) |
@@ -1087,4 +1087,5 @@ static void __exit inet_diag_exit(void) | |||
1087 | module_init(inet_diag_init); | 1087 | module_init(inet_diag_init); |
1088 | module_exit(inet_diag_exit); | 1088 | module_exit(inet_diag_exit); |
1089 | MODULE_LICENSE("GPL"); | 1089 | MODULE_LICENSE("GPL"); |
1090 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 0); | 1090 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2 /* AF_INET */); |
1091 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 10 /* AF_INET6 */); | ||
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c index 6334b1f71f2d..8cd357a8be79 100644 --- a/net/ipv4/tcp_diag.c +++ b/net/ipv4/tcp_diag.c | |||
@@ -66,4 +66,4 @@ static void __exit tcp_diag_exit(void) | |||
66 | module_init(tcp_diag_init); | 66 | module_init(tcp_diag_init); |
67 | module_exit(tcp_diag_exit); | 67 | module_exit(tcp_diag_exit); |
68 | MODULE_LICENSE("GPL"); | 68 | MODULE_LICENSE("GPL"); |
69 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 6); | 69 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-6 /* AF_INET - IPPROTO_TCP */); |
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c index 27910c133019..fe9db8675acb 100644 --- a/net/ipv4/udp_diag.c +++ b/net/ipv4/udp_diag.c | |||
@@ -197,5 +197,5 @@ static void __exit udp_diag_exit(void) | |||
197 | module_init(udp_diag_init); | 197 | module_init(udp_diag_init); |
198 | module_exit(udp_diag_exit); | 198 | module_exit(udp_diag_exit); |
199 | MODULE_LICENSE("GPL"); | 199 | MODULE_LICENSE("GPL"); |
200 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 17); | 200 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-17 /* AF_INET - IPPROTO_UDP */); |
201 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 136); | 201 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2-136 /* AF_INET - IPPROTO_UDPLITE */); |