diff options
author | Jan Engelhardt <jengelh@computergmbh.de> | 2008-04-14 05:15:35 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-04-14 05:15:35 -0400 |
commit | 5452e425adfdfc4647b618e303f73d48f2405b0e (patch) | |
tree | 7cad164e9517cee49556c6c85e4f40d3c7f6b2b7 /net/ipv6 | |
parent | 3cf93c96af7adf78542d45f8a27f0e5f8704409d (diff) |
[NETFILTER]: annotate {arp,ip,ip6,x}tables with const
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 70ef0d276cc0..782183f63366 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -325,7 +325,7 @@ static void trace_packet(struct sk_buff *skb, | |||
325 | struct ip6t_entry *e) | 325 | struct ip6t_entry *e) |
326 | { | 326 | { |
327 | void *table_base; | 327 | void *table_base; |
328 | struct ip6t_entry *root; | 328 | const struct ip6t_entry *root; |
329 | char *hookname, *chainname, *comment; | 329 | char *hookname, *chainname, *comment; |
330 | unsigned int rulenum = 0; | 330 | unsigned int rulenum = 0; |
331 | 331 | ||
@@ -952,7 +952,7 @@ static struct xt_counters *alloc_counters(struct xt_table *table) | |||
952 | { | 952 | { |
953 | unsigned int countersize; | 953 | unsigned int countersize; |
954 | struct xt_counters *counters; | 954 | struct xt_counters *counters; |
955 | struct xt_table_info *private = table->private; | 955 | const struct xt_table_info *private = table->private; |
956 | 956 | ||
957 | /* We need atomic snapshot of counters: rest doesn't change | 957 | /* We need atomic snapshot of counters: rest doesn't change |
958 | (other than comefrom, which userspace doesn't care | 958 | (other than comefrom, which userspace doesn't care |
@@ -979,9 +979,9 @@ copy_entries_to_user(unsigned int total_size, | |||
979 | unsigned int off, num; | 979 | unsigned int off, num; |
980 | struct ip6t_entry *e; | 980 | struct ip6t_entry *e; |
981 | struct xt_counters *counters; | 981 | struct xt_counters *counters; |
982 | struct xt_table_info *private = table->private; | 982 | const struct xt_table_info *private = table->private; |
983 | int ret = 0; | 983 | int ret = 0; |
984 | void *loc_cpu_entry; | 984 | const void *loc_cpu_entry; |
985 | 985 | ||
986 | counters = alloc_counters(table); | 986 | counters = alloc_counters(table); |
987 | if (IS_ERR(counters)) | 987 | if (IS_ERR(counters)) |
@@ -1001,8 +1001,8 @@ copy_entries_to_user(unsigned int total_size, | |||
1001 | /* ... then go back and fix counters and names */ | 1001 | /* ... then go back and fix counters and names */ |
1002 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ | 1002 | for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ |
1003 | unsigned int i; | 1003 | unsigned int i; |
1004 | struct ip6t_entry_match *m; | 1004 | const struct ip6t_entry_match *m; |
1005 | struct ip6t_entry_target *t; | 1005 | const struct ip6t_entry_target *t; |
1006 | 1006 | ||
1007 | e = (struct ip6t_entry *)(loc_cpu_entry + off); | 1007 | e = (struct ip6t_entry *)(loc_cpu_entry + off); |
1008 | if (copy_to_user(userptr + off | 1008 | if (copy_to_user(userptr + off |
@@ -1142,7 +1142,7 @@ static int get_info(struct net *net, void __user *user, int *len, int compat) | |||
1142 | "ip6table_%s", name); | 1142 | "ip6table_%s", name); |
1143 | if (t && !IS_ERR(t)) { | 1143 | if (t && !IS_ERR(t)) { |
1144 | struct ip6t_getinfo info; | 1144 | struct ip6t_getinfo info; |
1145 | struct xt_table_info *private = t->private; | 1145 | const struct xt_table_info *private = t->private; |
1146 | 1146 | ||
1147 | #ifdef CONFIG_COMPAT | 1147 | #ifdef CONFIG_COMPAT |
1148 | if (compat) { | 1148 | if (compat) { |
@@ -1225,7 +1225,7 @@ __do_replace(struct net *net, const char *name, unsigned int valid_hooks, | |||
1225 | struct xt_table *t; | 1225 | struct xt_table *t; |
1226 | struct xt_table_info *oldinfo; | 1226 | struct xt_table_info *oldinfo; |
1227 | struct xt_counters *counters; | 1227 | struct xt_counters *counters; |
1228 | void *loc_cpu_old_entry; | 1228 | const void *loc_cpu_old_entry; |
1229 | 1229 | ||
1230 | ret = 0; | 1230 | ret = 0; |
1231 | counters = vmalloc_node(num_counters * sizeof(struct xt_counters), | 1231 | counters = vmalloc_node(num_counters * sizeof(struct xt_counters), |
@@ -1369,9 +1369,9 @@ do_add_counters(struct net *net, void __user *user, unsigned int len, | |||
1369 | int size; | 1369 | int size; |
1370 | void *ptmp; | 1370 | void *ptmp; |
1371 | struct xt_table *t; | 1371 | struct xt_table *t; |
1372 | struct xt_table_info *private; | 1372 | const struct xt_table_info *private; |
1373 | int ret = 0; | 1373 | int ret = 0; |
1374 | void *loc_cpu_entry; | 1374 | const void *loc_cpu_entry; |
1375 | #ifdef CONFIG_COMPAT | 1375 | #ifdef CONFIG_COMPAT |
1376 | struct compat_xt_counters_info compat_tmp; | 1376 | struct compat_xt_counters_info compat_tmp; |
1377 | 1377 | ||
@@ -1905,11 +1905,11 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table, | |||
1905 | void __user *userptr) | 1905 | void __user *userptr) |
1906 | { | 1906 | { |
1907 | struct xt_counters *counters; | 1907 | struct xt_counters *counters; |
1908 | struct xt_table_info *private = table->private; | 1908 | const struct xt_table_info *private = table->private; |
1909 | void __user *pos; | 1909 | void __user *pos; |
1910 | unsigned int size; | 1910 | unsigned int size; |
1911 | int ret = 0; | 1911 | int ret = 0; |
1912 | void *loc_cpu_entry; | 1912 | const void *loc_cpu_entry; |
1913 | unsigned int i = 0; | 1913 | unsigned int i = 0; |
1914 | 1914 | ||
1915 | counters = alloc_counters(table); | 1915 | counters = alloc_counters(table); |
@@ -1956,7 +1956,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr, | |||
1956 | xt_compat_lock(AF_INET6); | 1956 | xt_compat_lock(AF_INET6); |
1957 | t = xt_find_table_lock(net, AF_INET6, get.name); | 1957 | t = xt_find_table_lock(net, AF_INET6, get.name); |
1958 | if (t && !IS_ERR(t)) { | 1958 | if (t && !IS_ERR(t)) { |
1959 | struct xt_table_info *private = t->private; | 1959 | const struct xt_table_info *private = t->private; |
1960 | struct xt_table_info info; | 1960 | struct xt_table_info info; |
1961 | duprintf("t->private->number = %u\n", private->number); | 1961 | duprintf("t->private->number = %u\n", private->number); |
1962 | ret = compat_table_info(private, &info); | 1962 | ret = compat_table_info(private, &info); |
@@ -2155,7 +2155,8 @@ icmp6_match(const struct sk_buff *skb, | |||
2155 | unsigned int protoff, | 2155 | unsigned int protoff, |
2156 | bool *hotdrop) | 2156 | bool *hotdrop) |
2157 | { | 2157 | { |
2158 | struct icmp6hdr _icmph, *ic; | 2158 | const struct icmp6hdr *ic; |
2159 | struct icmp6hdr _icmph; | ||
2159 | const struct ip6t_icmp *icmpinfo = matchinfo; | 2160 | const struct ip6t_icmp *icmpinfo = matchinfo; |
2160 | 2161 | ||
2161 | /* Must not be a fragment. */ | 2162 | /* Must not be a fragment. */ |