Commit 58c0fb0ddd92e5105d61fc85b6e7af7b1f669067

Authored by Jan Engelhardt
Committed by Patrick McHardy
1 parent 5452e425ad

[NETFILTER]: annotate rest of nf_conntrack_* with const

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 5 changed files with 17 additions and 14 deletions Side-by-side Diff

net/ipv6/netfilter/nf_conntrack_reasm.c
... ... @@ -103,8 +103,8 @@
103 103 };
104 104 #endif
105 105  
106   -static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
107   - struct in6_addr *daddr)
  106 +static unsigned int ip6qhashfn(__be32 id, const struct in6_addr *saddr,
  107 + const struct in6_addr *daddr)
108 108 {
109 109 u32 a, b, c;
110 110  
... ... @@ -132,7 +132,7 @@
132 132  
133 133 static unsigned int nf_hashfn(struct inet_frag_queue *q)
134 134 {
135   - struct nf_ct_frag6_queue *nq;
  135 + const struct nf_ct_frag6_queue *nq;
136 136  
137 137 nq = container_of(q, struct nf_ct_frag6_queue, q);
138 138 return ip6qhashfn(nq->id, &nq->saddr, &nq->daddr);
... ... @@ -222,7 +222,7 @@
222 222  
223 223  
224 224 static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
225   - struct frag_hdr *fhdr, int nhoff)
  225 + const struct frag_hdr *fhdr, int nhoff)
226 226 {
227 227 struct sk_buff *prev, *next;
228 228 int offset, end;
net/netfilter/nf_conntrack_amanda.c
... ... @@ -53,7 +53,7 @@
53 53 };
54 54  
55 55 static struct {
56   - char *string;
  56 + const char *string;
57 57 size_t len;
58 58 struct ts_config *ts;
59 59 } search[] __read_mostly = {
net/netfilter/nf_conntrack_ftp.c
... ... @@ -350,8 +350,9 @@
350 350 enum ip_conntrack_info ctinfo)
351 351 {
352 352 unsigned int dataoff, datalen;
353   - struct tcphdr _tcph, *th;
354   - char *fb_ptr;
  353 + const struct tcphdr *th;
  354 + struct tcphdr _tcph;
  355 + const char *fb_ptr;
355 356 int ret;
356 357 u32 seq;
357 358 int dir = CTINFO2DIR(ctinfo);
net/netfilter/nf_conntrack_helper.c
... ... @@ -126,7 +126,7 @@
126 126 {
127 127 struct nf_conntrack_tuple_hash *h;
128 128 struct nf_conntrack_expect *exp;
129   - struct hlist_node *n, *next;
  129 + const struct hlist_node *n, *next;
130 130 unsigned int i;
131 131  
132 132 mutex_lock(&nf_ct_helper_mutex);
net/netfilter/nf_conntrack_irc.c
... ... @@ -50,7 +50,7 @@
50 50 module_param(dcc_timeout, uint, 0400);
51 51 MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels");
52 52  
53   -static const char *dccprotos[] = {
  53 +static const char *const dccprotos[] = {
54 54 "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT "
55 55 };
56 56  
... ... @@ -65,7 +65,7 @@
65 65 * ad_beg_p returns pointer to first byte of addr data
66 66 * ad_end_p returns pointer to last byte of addr data
67 67 */
68   -static int parse_dcc(char *data, char *data_end, u_int32_t *ip,
  68 +static int parse_dcc(char *data, const char *data_end, u_int32_t *ip,
69 69 u_int16_t *port, char **ad_beg_p, char **ad_end_p)
70 70 {
71 71 /* at least 12: "AAAAAAAA P\1\n" */
... ... @@ -93,9 +93,11 @@
93 93 struct nf_conn *ct, enum ip_conntrack_info ctinfo)
94 94 {
95 95 unsigned int dataoff;
96   - struct iphdr *iph;
97   - struct tcphdr _tcph, *th;
98   - char *data, *data_limit, *ib_ptr;
  96 + const struct iphdr *iph;
  97 + const struct tcphdr *th;
  98 + struct tcphdr _tcph;
  99 + const char *data_limit;
  100 + char *data, *ib_ptr;
99 101 int dir = CTINFO2DIR(ctinfo);
100 102 struct nf_conntrack_expect *exp;
101 103 struct nf_conntrack_tuple *tuple;
... ... @@ -159,7 +161,7 @@
159 161 /* we have at least
160 162 * (19+MINMATCHLEN)-5-dccprotos[i].matchlen bytes valid
161 163 * data left (== 14/13 bytes) */
162   - if (parse_dcc((char *)data, data_limit, &dcc_ip,
  164 + if (parse_dcc(data, data_limit, &dcc_ip,
163 165 &dcc_port, &addr_beg_p, &addr_end_p)) {
164 166 pr_debug("unable to parse dcc command\n");
165 167 continue;