diff options
author | Jan Engelhardt <jengelh@computergmbh.de> | 2008-04-14 03:56:05 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-04-14 03:56:05 -0400 |
commit | 3cf93c96af7adf78542d45f8a27f0e5f8704409d (patch) | |
tree | 1559a1c55ef406f9aa8efdc2d5dc8ed42059c1df /net/ipv4 | |
parent | b9f61b160336da5eaaacb0cb41ebe32169e3bde5 (diff) |
[NETFILTER]: annotate xtables targets with const and remove casts
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 12 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ECN.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_LOG.c | 3 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_REJECT.c | 6 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_recent.c | 6 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_rule.c | 4 |
6 files changed, 18 insertions, 15 deletions
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 965b08a7d73..2510d4fcdb5 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -142,7 +142,7 @@ clusterip_config_init_nodelist(struct clusterip_config *c, | |||
142 | } | 142 | } |
143 | 143 | ||
144 | static struct clusterip_config * | 144 | static struct clusterip_config * |
145 | clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip, | 145 | clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip, |
146 | struct net_device *dev) | 146 | struct net_device *dev) |
147 | { | 147 | { |
148 | struct clusterip_config *c; | 148 | struct clusterip_config *c; |
@@ -416,7 +416,7 @@ clusterip_tg_check(const char *tablename, const void *e_void, | |||
416 | /* drop reference count of cluster config when rule is deleted */ | 416 | /* drop reference count of cluster config when rule is deleted */ |
417 | static void clusterip_tg_destroy(const struct xt_target *target, void *targinfo) | 417 | static void clusterip_tg_destroy(const struct xt_target *target, void *targinfo) |
418 | { | 418 | { |
419 | struct ipt_clusterip_tgt_info *cipinfo = targinfo; | 419 | const struct ipt_clusterip_tgt_info *cipinfo = targinfo; |
420 | 420 | ||
421 | /* if no more entries are referencing the config, remove it | 421 | /* if no more entries are referencing the config, remove it |
422 | * from the list and destroy the proc entry */ | 422 | * from the list and destroy the proc entry */ |
@@ -565,7 +565,7 @@ struct clusterip_seq_position { | |||
565 | 565 | ||
566 | static void *clusterip_seq_start(struct seq_file *s, loff_t *pos) | 566 | static void *clusterip_seq_start(struct seq_file *s, loff_t *pos) |
567 | { | 567 | { |
568 | struct proc_dir_entry *pde = s->private; | 568 | const struct proc_dir_entry *pde = s->private; |
569 | struct clusterip_config *c = pde->data; | 569 | struct clusterip_config *c = pde->data; |
570 | unsigned int weight; | 570 | unsigned int weight; |
571 | u_int32_t local_nodes; | 571 | u_int32_t local_nodes; |
@@ -592,7 +592,7 @@ static void *clusterip_seq_start(struct seq_file *s, loff_t *pos) | |||
592 | 592 | ||
593 | static void *clusterip_seq_next(struct seq_file *s, void *v, loff_t *pos) | 593 | static void *clusterip_seq_next(struct seq_file *s, void *v, loff_t *pos) |
594 | { | 594 | { |
595 | struct clusterip_seq_position *idx = (struct clusterip_seq_position *)v; | 595 | struct clusterip_seq_position *idx = v; |
596 | 596 | ||
597 | *pos = ++idx->pos; | 597 | *pos = ++idx->pos; |
598 | if (*pos >= idx->weight) { | 598 | if (*pos >= idx->weight) { |
@@ -611,7 +611,7 @@ static void clusterip_seq_stop(struct seq_file *s, void *v) | |||
611 | 611 | ||
612 | static int clusterip_seq_show(struct seq_file *s, void *v) | 612 | static int clusterip_seq_show(struct seq_file *s, void *v) |
613 | { | 613 | { |
614 | struct clusterip_seq_position *idx = (struct clusterip_seq_position *)v; | 614 | struct clusterip_seq_position *idx = v; |
615 | 615 | ||
616 | if (idx->pos != 0) | 616 | if (idx->pos != 0) |
617 | seq_putc(s, ','); | 617 | seq_putc(s, ','); |
@@ -667,7 +667,7 @@ static ssize_t clusterip_proc_write(struct file *file, const char __user *input, | |||
667 | { | 667 | { |
668 | #define PROC_WRITELEN 10 | 668 | #define PROC_WRITELEN 10 |
669 | char buffer[PROC_WRITELEN+1]; | 669 | char buffer[PROC_WRITELEN+1]; |
670 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 670 | const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); |
671 | struct clusterip_config *c = pde->data; | 671 | struct clusterip_config *c = pde->data; |
672 | unsigned long nodenum; | 672 | unsigned long nodenum; |
673 | 673 | ||
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index 21395bc2b27..d60139c134c 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c | |||
@@ -100,7 +100,7 @@ ecn_tg_check(const char *tablename, const void *e_void, | |||
100 | const struct xt_target *target, void *targinfo, | 100 | const struct xt_target *target, void *targinfo, |
101 | unsigned int hook_mask) | 101 | unsigned int hook_mask) |
102 | { | 102 | { |
103 | const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo; | 103 | const struct ipt_ECN_info *einfo = targinfo; |
104 | const struct ipt_entry *e = e_void; | 104 | const struct ipt_entry *e = e_void; |
105 | 105 | ||
106 | if (einfo->operation & IPT_ECN_OP_MASK) { | 106 | if (einfo->operation & IPT_ECN_OP_MASK) { |
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index c40e233e271..0af14137137 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c | |||
@@ -76,7 +76,8 @@ static void dump_packet(const struct nf_loginfo *info, | |||
76 | 76 | ||
77 | if ((logflags & IPT_LOG_IPOPT) | 77 | if ((logflags & IPT_LOG_IPOPT) |
78 | && ih->ihl * 4 > sizeof(struct iphdr)) { | 78 | && ih->ihl * 4 > sizeof(struct iphdr)) { |
79 | unsigned char _opt[4 * 15 - sizeof(struct iphdr)], *op; | 79 | const unsigned char *op; |
80 | unsigned char _opt[4 * 15 - sizeof(struct iphdr)]; | ||
80 | unsigned int i, optsize; | 81 | unsigned int i, optsize; |
81 | 82 | ||
82 | optsize = ih->ihl * 4 - sizeof(struct iphdr); | 83 | optsize = ih->ihl * 4 - sizeof(struct iphdr); |
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index 22606e2baa1..2639872849d 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
@@ -35,8 +35,10 @@ MODULE_DESCRIPTION("Xtables: packet \"rejection\" target for IPv4"); | |||
35 | static void send_reset(struct sk_buff *oldskb, int hook) | 35 | static void send_reset(struct sk_buff *oldskb, int hook) |
36 | { | 36 | { |
37 | struct sk_buff *nskb; | 37 | struct sk_buff *nskb; |
38 | struct iphdr *oiph, *niph; | 38 | const struct iphdr *oiph; |
39 | struct tcphdr _otcph, *oth, *tcph; | 39 | struct iphdr *niph; |
40 | const struct tcphdr *oth; | ||
41 | struct tcphdr _otcph, *tcph; | ||
40 | unsigned int addr_type; | 42 | unsigned int addr_type; |
41 | 43 | ||
42 | /* IP header checks: fragment. */ | 44 | /* IP header checks: fragment. */ |
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 50e06690eb5..21cb053f5d7 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -340,7 +340,7 @@ static void *recent_seq_start(struct seq_file *seq, loff_t *pos) | |||
340 | static void *recent_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 340 | static void *recent_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
341 | { | 341 | { |
342 | struct recent_iter_state *st = seq->private; | 342 | struct recent_iter_state *st = seq->private; |
343 | struct recent_table *t = st->table; | 343 | const struct recent_table *t = st->table; |
344 | struct recent_entry *e = v; | 344 | struct recent_entry *e = v; |
345 | struct list_head *head = e->list.next; | 345 | struct list_head *head = e->list.next; |
346 | 346 | ||
@@ -361,7 +361,7 @@ static void recent_seq_stop(struct seq_file *s, void *v) | |||
361 | 361 | ||
362 | static int recent_seq_show(struct seq_file *seq, void *v) | 362 | static int recent_seq_show(struct seq_file *seq, void *v) |
363 | { | 363 | { |
364 | struct recent_entry *e = v; | 364 | const struct recent_entry *e = v; |
365 | unsigned int i; | 365 | unsigned int i; |
366 | 366 | ||
367 | i = (e->index - 1) % ip_pkt_list_tot; | 367 | i = (e->index - 1) % ip_pkt_list_tot; |
@@ -396,7 +396,7 @@ static int recent_seq_open(struct inode *inode, struct file *file) | |||
396 | static ssize_t recent_proc_write(struct file *file, const char __user *input, | 396 | static ssize_t recent_proc_write(struct file *file, const char __user *input, |
397 | size_t size, loff_t *loff) | 397 | size_t size, loff_t *loff) |
398 | { | 398 | { |
399 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 399 | const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); |
400 | struct recent_table *t = pde->data; | 400 | struct recent_table *t = pde->data; |
401 | struct recent_entry *e; | 401 | struct recent_entry *e; |
402 | char buf[sizeof("+255.255.255.255")], *c = buf; | 402 | char buf[sizeof("+255.255.255.255")], *c = buf; |
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c index e330a2974de..ebe0c7903ae 100644 --- a/net/ipv4/netfilter/nf_nat_rule.c +++ b/net/ipv4/netfilter/nf_nat_rule.c | |||
@@ -143,7 +143,7 @@ static bool ipt_snat_checkentry(const char *tablename, | |||
143 | void *targinfo, | 143 | void *targinfo, |
144 | unsigned int hook_mask) | 144 | unsigned int hook_mask) |
145 | { | 145 | { |
146 | struct nf_nat_multi_range_compat *mr = targinfo; | 146 | const struct nf_nat_multi_range_compat *mr = targinfo; |
147 | 147 | ||
148 | /* Must be a valid range */ | 148 | /* Must be a valid range */ |
149 | if (mr->rangesize != 1) { | 149 | if (mr->rangesize != 1) { |
@@ -159,7 +159,7 @@ static bool ipt_dnat_checkentry(const char *tablename, | |||
159 | void *targinfo, | 159 | void *targinfo, |
160 | unsigned int hook_mask) | 160 | unsigned int hook_mask) |
161 | { | 161 | { |
162 | struct nf_nat_multi_range_compat *mr = targinfo; | 162 | const struct nf_nat_multi_range_compat *mr = targinfo; |
163 | 163 | ||
164 | /* Must be a valid range */ | 164 | /* Must be a valid range */ |
165 | if (mr->rangesize != 1) { | 165 | if (mr->rangesize != 1) { |