diff options
author | Jan Engelhardt <jengelh@computergmbh.de> | 2008-01-31 07:53:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-31 22:28:13 -0500 |
commit | 32948588ac4ec54300bae1037e839277fd4536e2 (patch) | |
tree | 69836aa043bcd3b5207047558bbbd4866f97dc36 /net/ipv4 | |
parent | 7cc3864d39837549c5ccb33c5b85183d6e6986bc (diff) |
[NETFILTER]: nf_conntrack: annotate l3protos with const
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 14 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | 8 |
2 files changed, 12 insertions, 10 deletions
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index ac3d61d8026e..a65b845c5f15 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | |||
@@ -27,7 +27,8 @@ | |||
27 | static int ipv4_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, | 27 | static int ipv4_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, |
28 | struct nf_conntrack_tuple *tuple) | 28 | struct nf_conntrack_tuple *tuple) |
29 | { | 29 | { |
30 | __be32 _addrs[2], *ap; | 30 | const __be32 *ap; |
31 | __be32 _addrs[2]; | ||
31 | ap = skb_header_pointer(skb, nhoff + offsetof(struct iphdr, saddr), | 32 | ap = skb_header_pointer(skb, nhoff + offsetof(struct iphdr, saddr), |
32 | sizeof(u_int32_t) * 2, _addrs); | 33 | sizeof(u_int32_t) * 2, _addrs); |
33 | if (ap == NULL) | 34 | if (ap == NULL) |
@@ -76,7 +77,8 @@ static int nf_ct_ipv4_gather_frags(struct sk_buff *skb, u_int32_t user) | |||
76 | static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, | 77 | static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, |
77 | unsigned int *dataoff, u_int8_t *protonum) | 78 | unsigned int *dataoff, u_int8_t *protonum) |
78 | { | 79 | { |
79 | struct iphdr _iph, *iph; | 80 | const struct iphdr *iph; |
81 | struct iphdr _iph; | ||
80 | 82 | ||
81 | iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); | 83 | iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); |
82 | if (iph == NULL) | 84 | if (iph == NULL) |
@@ -111,8 +113,8 @@ static unsigned int ipv4_conntrack_help(unsigned int hooknum, | |||
111 | { | 113 | { |
112 | struct nf_conn *ct; | 114 | struct nf_conn *ct; |
113 | enum ip_conntrack_info ctinfo; | 115 | enum ip_conntrack_info ctinfo; |
114 | struct nf_conn_help *help; | 116 | const struct nf_conn_help *help; |
115 | struct nf_conntrack_helper *helper; | 117 | const struct nf_conntrack_helper *helper; |
116 | 118 | ||
117 | /* This is where we call the helper: as the packet goes out. */ | 119 | /* This is where we call the helper: as the packet goes out. */ |
118 | ct = nf_ct_get(skb, &ctinfo); | 120 | ct = nf_ct_get(skb, &ctinfo); |
@@ -299,8 +301,8 @@ static ctl_table ip_ct_sysctl_table[] = { | |||
299 | static int | 301 | static int |
300 | getorigdst(struct sock *sk, int optval, void __user *user, int *len) | 302 | getorigdst(struct sock *sk, int optval, void __user *user, int *len) |
301 | { | 303 | { |
302 | struct inet_sock *inet = inet_sk(sk); | 304 | const struct inet_sock *inet = inet_sk(sk); |
303 | struct nf_conntrack_tuple_hash *h; | 305 | const struct nf_conntrack_tuple_hash *h; |
304 | struct nf_conntrack_tuple tuple; | 306 | struct nf_conntrack_tuple tuple; |
305 | 307 | ||
306 | NF_CT_TUPLE_U_BLANK(&tuple); | 308 | NF_CT_TUPLE_U_BLANK(&tuple); |
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index 0ee87edbd286..089252e82c01 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | |||
@@ -98,8 +98,8 @@ static int ct_seq_show(struct seq_file *s, void *v) | |||
98 | { | 98 | { |
99 | const struct nf_conntrack_tuple_hash *hash = v; | 99 | const struct nf_conntrack_tuple_hash *hash = v; |
100 | const struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(hash); | 100 | const struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(hash); |
101 | struct nf_conntrack_l3proto *l3proto; | 101 | const struct nf_conntrack_l3proto *l3proto; |
102 | struct nf_conntrack_l4proto *l4proto; | 102 | const struct nf_conntrack_l4proto *l4proto; |
103 | 103 | ||
104 | NF_CT_ASSERT(ct); | 104 | NF_CT_ASSERT(ct); |
105 | 105 | ||
@@ -251,7 +251,7 @@ static void exp_seq_stop(struct seq_file *seq, void *v) | |||
251 | static int exp_seq_show(struct seq_file *s, void *v) | 251 | static int exp_seq_show(struct seq_file *s, void *v) |
252 | { | 252 | { |
253 | struct nf_conntrack_expect *exp; | 253 | struct nf_conntrack_expect *exp; |
254 | struct hlist_node *n = v; | 254 | const struct hlist_node *n = v; |
255 | 255 | ||
256 | exp = hlist_entry(n, struct nf_conntrack_expect, hnode); | 256 | exp = hlist_entry(n, struct nf_conntrack_expect, hnode); |
257 | 257 | ||
@@ -332,7 +332,7 @@ static void ct_cpu_seq_stop(struct seq_file *seq, void *v) | |||
332 | static int ct_cpu_seq_show(struct seq_file *seq, void *v) | 332 | static int ct_cpu_seq_show(struct seq_file *seq, void *v) |
333 | { | 333 | { |
334 | unsigned int nr_conntracks = atomic_read(&nf_conntrack_count); | 334 | unsigned int nr_conntracks = atomic_read(&nf_conntrack_count); |
335 | struct ip_conntrack_stat *st = v; | 335 | const struct ip_conntrack_stat *st = v; |
336 | 336 | ||
337 | if (v == SEQ_START_TOKEN) { | 337 | if (v == SEQ_START_TOKEN) { |
338 | seq_printf(seq, "entries searched found new invalid ignore delete delete_list insert insert_failed drop early_drop icmp_error expect_new expect_create expect_delete\n"); | 338 | seq_printf(seq, "entries searched found new invalid ignore delete delete_list insert insert_failed drop early_drop icmp_error expect_new expect_create expect_delete\n"); |