aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sock_diag.h4
-rw-r--r--net/core/sock_diag.c12
-rw-r--r--net/ipv4/inet_diag.c4
-rw-r--r--net/unix/diag.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index 251729a47880..db4bae78bda9 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -32,8 +32,8 @@ struct sock_diag_handler {
32 int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh); 32 int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
33}; 33};
34 34
35int sock_diag_register(struct sock_diag_handler *h); 35int sock_diag_register(const struct sock_diag_handler *h);
36void sock_diag_unregister(struct sock_diag_handler *h); 36void sock_diag_unregister(const struct sock_diag_handler *h);
37 37
38void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh)); 38void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
39void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh)); 39void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
index b9868e1fd62c..5fd146720f39 100644
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -10,7 +10,7 @@
10#include <linux/inet_diag.h> 10#include <linux/inet_diag.h>
11#include <linux/sock_diag.h> 11#include <linux/sock_diag.h>
12 12
13static struct sock_diag_handler *sock_diag_handlers[AF_MAX]; 13static const struct sock_diag_handler *sock_diag_handlers[AF_MAX];
14static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh); 14static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh);
15static DEFINE_MUTEX(sock_diag_table_mutex); 15static DEFINE_MUTEX(sock_diag_table_mutex);
16 16
@@ -70,7 +70,7 @@ void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlms
70} 70}
71EXPORT_SYMBOL_GPL(sock_diag_unregister_inet_compat); 71EXPORT_SYMBOL_GPL(sock_diag_unregister_inet_compat);
72 72
73int sock_diag_register(struct sock_diag_handler *hndl) 73int sock_diag_register(const struct sock_diag_handler *hndl)
74{ 74{
75 int err = 0; 75 int err = 0;
76 76
@@ -88,7 +88,7 @@ int sock_diag_register(struct sock_diag_handler *hndl)
88} 88}
89EXPORT_SYMBOL_GPL(sock_diag_register); 89EXPORT_SYMBOL_GPL(sock_diag_register);
90 90
91void sock_diag_unregister(struct sock_diag_handler *hnld) 91void sock_diag_unregister(const struct sock_diag_handler *hnld)
92{ 92{
93 int family = hnld->family; 93 int family = hnld->family;
94 94
@@ -102,7 +102,7 @@ void sock_diag_unregister(struct sock_diag_handler *hnld)
102} 102}
103EXPORT_SYMBOL_GPL(sock_diag_unregister); 103EXPORT_SYMBOL_GPL(sock_diag_unregister);
104 104
105static inline struct sock_diag_handler *sock_diag_lock_handler(int family) 105static const inline struct sock_diag_handler *sock_diag_lock_handler(int family)
106{ 106{
107 if (sock_diag_handlers[family] == NULL) 107 if (sock_diag_handlers[family] == NULL)
108 request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, 108 request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
@@ -112,7 +112,7 @@ static inline struct sock_diag_handler *sock_diag_lock_handler(int family)
112 return sock_diag_handlers[family]; 112 return sock_diag_handlers[family];
113} 113}
114 114
115static inline void sock_diag_unlock_handler(struct sock_diag_handler *h) 115static inline void sock_diag_unlock_handler(const struct sock_diag_handler *h)
116{ 116{
117 mutex_unlock(&sock_diag_table_mutex); 117 mutex_unlock(&sock_diag_table_mutex);
118} 118}
@@ -121,7 +121,7 @@ static int __sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
121{ 121{
122 int err; 122 int err;
123 struct sock_diag_req *req = NLMSG_DATA(nlh); 123 struct sock_diag_req *req = NLMSG_DATA(nlh);
124 struct sock_diag_handler *hndl; 124 const struct sock_diag_handler *hndl;
125 125
126 if (nlmsg_len(nlh) < sizeof(*req)) 126 if (nlmsg_len(nlh) < sizeof(*req))
127 return -EINVAL; 127 return -EINVAL;
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 8d25a1c557eb..9f24028a3ba7 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -999,12 +999,12 @@ static int inet_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
999 return inet_diag_get_exact(skb, h, (struct inet_diag_req_v2 *)NLMSG_DATA(h)); 999 return inet_diag_get_exact(skb, h, (struct inet_diag_req_v2 *)NLMSG_DATA(h));
1000} 1000}
1001 1001
1002static struct sock_diag_handler inet_diag_handler = { 1002static const struct sock_diag_handler inet_diag_handler = {
1003 .family = AF_INET, 1003 .family = AF_INET,
1004 .dump = inet_diag_handler_dump, 1004 .dump = inet_diag_handler_dump,
1005}; 1005};
1006 1006
1007static struct sock_diag_handler inet6_diag_handler = { 1007static const struct sock_diag_handler inet6_diag_handler = {
1008 .family = AF_INET6, 1008 .family = AF_INET6,
1009 .dump = inet_diag_handler_dump, 1009 .dump = inet_diag_handler_dump,
1010}; 1010};
diff --git a/net/unix/diag.c b/net/unix/diag.c
index f0486ae9ebe6..47d3002737f5 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -310,7 +310,7 @@ static int unix_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
310 return unix_diag_get_exact(skb, h, (struct unix_diag_req *)NLMSG_DATA(h)); 310 return unix_diag_get_exact(skb, h, (struct unix_diag_req *)NLMSG_DATA(h));
311} 311}
312 312
313static struct sock_diag_handler unix_diag_handler = { 313static const struct sock_diag_handler unix_diag_handler = {
314 .family = AF_UNIX, 314 .family = AF_UNIX,
315 .dump = unix_diag_handler_dump, 315 .dump = unix_diag_handler_dump,
316}; 316};