diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/core/sock_diag.c | 12 | ||||
| -rw-r--r-- | net/ipv4/inet_diag.c | 4 | ||||
| -rw-r--r-- | net/unix/diag.c | 2 |
3 files changed, 9 insertions, 9 deletions
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 | ||
| 13 | static struct sock_diag_handler *sock_diag_handlers[AF_MAX]; | 13 | static const struct sock_diag_handler *sock_diag_handlers[AF_MAX]; |
| 14 | static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh); | 14 | static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh); |
| 15 | static DEFINE_MUTEX(sock_diag_table_mutex); | 15 | static 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 | } |
| 71 | EXPORT_SYMBOL_GPL(sock_diag_unregister_inet_compat); | 71 | EXPORT_SYMBOL_GPL(sock_diag_unregister_inet_compat); |
| 72 | 72 | ||
| 73 | int sock_diag_register(struct sock_diag_handler *hndl) | 73 | int 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 | } |
| 89 | EXPORT_SYMBOL_GPL(sock_diag_register); | 89 | EXPORT_SYMBOL_GPL(sock_diag_register); |
| 90 | 90 | ||
| 91 | void sock_diag_unregister(struct sock_diag_handler *hnld) | 91 | void 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 | } |
| 103 | EXPORT_SYMBOL_GPL(sock_diag_unregister); | 103 | EXPORT_SYMBOL_GPL(sock_diag_unregister); |
| 104 | 104 | ||
| 105 | static inline struct sock_diag_handler *sock_diag_lock_handler(int family) | 105 | static 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 | ||
| 115 | static inline void sock_diag_unlock_handler(struct sock_diag_handler *h) | 115 | static 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 | ||
| 1002 | static struct sock_diag_handler inet_diag_handler = { | 1002 | static 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 | ||
| 1007 | static struct sock_diag_handler inet6_diag_handler = { | 1007 | static 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 | ||
| 313 | static struct sock_diag_handler unix_diag_handler = { | 313 | static 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 | }; |
