diff options
author | Patrick McHardy <kaber@trash.net> | 2007-09-28 17:15:45 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:30 -0400 |
commit | 7c8d4cb4198d199e65a6ced8c81f71e3ac3f4cfc (patch) | |
tree | f931048ba1e765b8a6189cd8d16d20e514f1fc44 /net/netfilter/nfnetlink.c | |
parent | 169e36742572934f5d846cfa5f9d76e72d505db4 (diff) |
[NETFILTER]: nfnetlink: make subsystem and callbacks const
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nfnetlink.c')
-rw-r--r-- | net/netfilter/nfnetlink.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 4aa56e7ff15..032224c1409 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -41,7 +41,7 @@ MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_NETFILTER); | |||
41 | static char __initdata nfversion[] = "0.30"; | 41 | static char __initdata nfversion[] = "0.30"; |
42 | 42 | ||
43 | static struct sock *nfnl = NULL; | 43 | static struct sock *nfnl = NULL; |
44 | static struct nfnetlink_subsystem *subsys_table[NFNL_SUBSYS_COUNT]; | 44 | static const struct nfnetlink_subsystem *subsys_table[NFNL_SUBSYS_COUNT]; |
45 | static DEFINE_MUTEX(nfnl_mutex); | 45 | static DEFINE_MUTEX(nfnl_mutex); |
46 | 46 | ||
47 | static void nfnl_lock(void) | 47 | static void nfnl_lock(void) |
@@ -66,7 +66,7 @@ static void nfnl_unlock(void) | |||
66 | nfnl->sk_data_ready(nfnl, 0); | 66 | nfnl->sk_data_ready(nfnl, 0); |
67 | } | 67 | } |
68 | 68 | ||
69 | int nfnetlink_subsys_register(struct nfnetlink_subsystem *n) | 69 | int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n) |
70 | { | 70 | { |
71 | nfnl_lock(); | 71 | nfnl_lock(); |
72 | if (subsys_table[n->subsys_id]) { | 72 | if (subsys_table[n->subsys_id]) { |
@@ -80,7 +80,7 @@ int nfnetlink_subsys_register(struct nfnetlink_subsystem *n) | |||
80 | } | 80 | } |
81 | EXPORT_SYMBOL_GPL(nfnetlink_subsys_register); | 81 | EXPORT_SYMBOL_GPL(nfnetlink_subsys_register); |
82 | 82 | ||
83 | int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n) | 83 | int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n) |
84 | { | 84 | { |
85 | nfnl_lock(); | 85 | nfnl_lock(); |
86 | subsys_table[n->subsys_id] = NULL; | 86 | subsys_table[n->subsys_id] = NULL; |
@@ -90,7 +90,7 @@ int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n) | |||
90 | } | 90 | } |
91 | EXPORT_SYMBOL_GPL(nfnetlink_subsys_unregister); | 91 | EXPORT_SYMBOL_GPL(nfnetlink_subsys_unregister); |
92 | 92 | ||
93 | static inline struct nfnetlink_subsystem *nfnetlink_get_subsys(u_int16_t type) | 93 | static inline const struct nfnetlink_subsystem *nfnetlink_get_subsys(u_int16_t type) |
94 | { | 94 | { |
95 | u_int8_t subsys_id = NFNL_SUBSYS_ID(type); | 95 | u_int8_t subsys_id = NFNL_SUBSYS_ID(type); |
96 | 96 | ||
@@ -100,8 +100,8 @@ static inline struct nfnetlink_subsystem *nfnetlink_get_subsys(u_int16_t type) | |||
100 | return subsys_table[subsys_id]; | 100 | return subsys_table[subsys_id]; |
101 | } | 101 | } |
102 | 102 | ||
103 | static inline struct nfnl_callback * | 103 | static inline const struct nfnl_callback * |
104 | nfnetlink_find_client(u_int16_t type, struct nfnetlink_subsystem *ss) | 104 | nfnetlink_find_client(u_int16_t type, const struct nfnetlink_subsystem *ss) |
105 | { | 105 | { |
106 | u_int8_t cb_id = NFNL_MSG_TYPE(type); | 106 | u_int8_t cb_id = NFNL_MSG_TYPE(type); |
107 | 107 | ||
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(nfattr_parse); | |||
147 | * | 147 | * |
148 | */ | 148 | */ |
149 | static int | 149 | static int |
150 | nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys, | 150 | nfnetlink_check_attributes(const struct nfnetlink_subsystem *subsys, |
151 | struct nlmsghdr *nlh, struct nfattr *cda[]) | 151 | struct nlmsghdr *nlh, struct nfattr *cda[]) |
152 | { | 152 | { |
153 | int min_len = NLMSG_SPACE(sizeof(struct nfgenmsg)); | 153 | int min_len = NLMSG_SPACE(sizeof(struct nfgenmsg)); |
@@ -197,8 +197,8 @@ EXPORT_SYMBOL_GPL(nfnetlink_unicast); | |||
197 | /* Process one complete nfnetlink message. */ | 197 | /* Process one complete nfnetlink message. */ |
198 | static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | 198 | static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
199 | { | 199 | { |
200 | struct nfnl_callback *nc; | 200 | const struct nfnl_callback *nc; |
201 | struct nfnetlink_subsystem *ss; | 201 | const struct nfnetlink_subsystem *ss; |
202 | int type, err; | 202 | int type, err; |
203 | 203 | ||
204 | if (security_netlink_recv(skb, CAP_NET_ADMIN)) | 204 | if (security_netlink_recv(skb, CAP_NET_ADMIN)) |