aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-12-05 04:23:57 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:09 -0500
commite3ac5298159c5286cef86f0865d4fa6a606bd391 (patch)
treee2d398667438d5e9e4cb688af03a37c6198e2e72
parentfb46990dba94866462e90623e183d02ec591cf8f (diff)
[NETFILTER]: nf_queue: make queue_handler const
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netfilter.h8
-rw-r--r--net/ipv4/netfilter/ip_queue.c2
-rw-r--r--net/ipv6/netfilter/ip6_queue.c2
-rw-r--r--net/netfilter/nf_queue.c12
-rw-r--r--net/netfilter/nfnetlink_queue.c2
5 files changed, 13 insertions, 13 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 9bfc7d4f5868..c2c3fafa5fd0 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -281,11 +281,11 @@ struct nf_queue_handler {
281 void *data; 281 void *data;
282 char *name; 282 char *name;
283}; 283};
284extern int nf_register_queue_handler(int pf, 284extern int nf_register_queue_handler(int pf,
285 struct nf_queue_handler *qh); 285 const struct nf_queue_handler *qh);
286extern int nf_unregister_queue_handler(int pf, 286extern int nf_unregister_queue_handler(int pf,
287 struct nf_queue_handler *qh); 287 const struct nf_queue_handler *qh);
288extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); 288extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh);
289extern void nf_reinject(struct sk_buff *skb, 289extern void nf_reinject(struct sk_buff *skb,
290 struct nf_info *info, 290 struct nf_info *info,
291 unsigned int verdict); 291 unsigned int verdict);
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index 14d64a383db1..062ff196f2c5 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -645,7 +645,7 @@ static const struct file_operations ip_queue_proc_fops = {
645 .owner = THIS_MODULE, 645 .owner = THIS_MODULE,
646}; 646};
647 647
648static struct nf_queue_handler nfqh = { 648static const struct nf_queue_handler nfqh = {
649 .name = "ip_queue", 649 .name = "ip_queue",
650 .outfn = &ipq_enqueue_packet, 650 .outfn = &ipq_enqueue_packet,
651}; 651};
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index e273605eef85..d6e971bd9fe1 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -634,7 +634,7 @@ static const struct file_operations ip6_queue_proc_fops = {
634 .owner = THIS_MODULE, 634 .owner = THIS_MODULE,
635}; 635};
636 636
637static struct nf_queue_handler nfqh = { 637static const struct nf_queue_handler nfqh = {
638 .name = "ip6_queue", 638 .name = "ip6_queue",
639 .outfn = &ipq_enqueue_packet, 639 .outfn = &ipq_enqueue_packet,
640}; 640};
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index 0bea88c30e51..dd18126a1a6d 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -15,13 +15,13 @@
15 * long term mutex. The handler must provide an an outfn() to accept packets 15 * long term mutex. The handler must provide an an outfn() to accept packets
16 * for queueing and must reinject all packets it receives, no matter what. 16 * for queueing and must reinject all packets it receives, no matter what.
17 */ 17 */
18static struct nf_queue_handler *queue_handler[NPROTO]; 18static const struct nf_queue_handler *queue_handler[NPROTO];
19 19
20static DEFINE_MUTEX(queue_handler_mutex); 20static DEFINE_MUTEX(queue_handler_mutex);
21 21
22/* return EBUSY when somebody else is registered, return EEXIST if the 22/* return EBUSY when somebody else is registered, return EEXIST if the
23 * same handler is registered, return 0 in case of success. */ 23 * same handler is registered, return 0 in case of success. */
24int nf_register_queue_handler(int pf, struct nf_queue_handler *qh) 24int nf_register_queue_handler(int pf, const struct nf_queue_handler *qh)
25{ 25{
26 int ret; 26 int ret;
27 27
@@ -44,7 +44,7 @@ int nf_register_queue_handler(int pf, struct nf_queue_handler *qh)
44EXPORT_SYMBOL(nf_register_queue_handler); 44EXPORT_SYMBOL(nf_register_queue_handler);
45 45
46/* The caller must flush their queue before this */ 46/* The caller must flush their queue before this */
47int nf_unregister_queue_handler(int pf, struct nf_queue_handler *qh) 47int nf_unregister_queue_handler(int pf, const struct nf_queue_handler *qh)
48{ 48{
49 if (pf >= NPROTO) 49 if (pf >= NPROTO)
50 return -EINVAL; 50 return -EINVAL;
@@ -64,7 +64,7 @@ int nf_unregister_queue_handler(int pf, struct nf_queue_handler *qh)
64} 64}
65EXPORT_SYMBOL(nf_unregister_queue_handler); 65EXPORT_SYMBOL(nf_unregister_queue_handler);
66 66
67void nf_unregister_queue_handlers(struct nf_queue_handler *qh) 67void nf_unregister_queue_handlers(const struct nf_queue_handler *qh)
68{ 68{
69 int pf; 69 int pf;
70 70
@@ -98,7 +98,7 @@ static int __nf_queue(struct sk_buff *skb,
98 struct net_device *physoutdev = NULL; 98 struct net_device *physoutdev = NULL;
99#endif 99#endif
100 struct nf_afinfo *afinfo; 100 struct nf_afinfo *afinfo;
101 struct nf_queue_handler *qh; 101 const struct nf_queue_handler *qh;
102 102
103 /* QUEUE == DROP if noone is waiting, to be safe. */ 103 /* QUEUE == DROP if noone is waiting, to be safe. */
104 rcu_read_lock(); 104 rcu_read_lock();
@@ -313,7 +313,7 @@ static int seq_show(struct seq_file *s, void *v)
313{ 313{
314 int ret; 314 int ret;
315 loff_t *pos = v; 315 loff_t *pos = v;
316 struct nf_queue_handler *qh; 316 const struct nf_queue_handler *qh;
317 317
318 rcu_read_lock(); 318 rcu_read_lock();
319 qh = rcu_dereference(queue_handler[*pos]); 319 qh = rcu_dereference(queue_handler[*pos]);
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 3ceeffcf6f9d..b75091c8ae5e 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -849,7 +849,7 @@ static const struct nla_policy nfqa_cfg_policy[NFQA_CFG_MAX+1] = {
849 [NFQA_CFG_PARAMS] = { .len = sizeof(struct nfqnl_msg_config_params) }, 849 [NFQA_CFG_PARAMS] = { .len = sizeof(struct nfqnl_msg_config_params) },
850}; 850};
851 851
852static struct nf_queue_handler nfqh = { 852static const struct nf_queue_handler nfqh = {
853 .name = "nf_queue", 853 .name = "nf_queue",
854 .outfn = &nfqnl_enqueue_packet, 854 .outfn = &nfqnl_enqueue_packet,
855}; 855};