diff options
author | Joe Perches <joe@perches.com> | 2008-03-28 19:35:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-28 19:35:27 -0400 |
commit | bc578a54f0fd489d0722303f9a52508495ccaf9a (patch) | |
tree | 6d0820f88aec63d764bef404b326ef65042d29aa /net | |
parent | be2ce06b4962658d807410e58f7c6b739dc6a0c3 (diff) |
[NET]: Rename inet_frag.h identifiers COMPLETE, FIRST_IN, LAST_IN to INET_FRAG_*
On Fri, 2008-03-28 at 03:24 -0700, Andrew Morton wrote:
> they should all be renamed.
Done for include/net and net
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/inet_fragment.c | 10 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 17 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 15 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 17 |
4 files changed, 31 insertions, 28 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 724d69aed031..93170bfcc22e 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -104,10 +104,10 @@ void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f) | |||
104 | if (del_timer(&fq->timer)) | 104 | if (del_timer(&fq->timer)) |
105 | atomic_dec(&fq->refcnt); | 105 | atomic_dec(&fq->refcnt); |
106 | 106 | ||
107 | if (!(fq->last_in & COMPLETE)) { | 107 | if (!(fq->last_in & INET_FRAG_COMPLETE)) { |
108 | fq_unlink(fq, f); | 108 | fq_unlink(fq, f); |
109 | atomic_dec(&fq->refcnt); | 109 | atomic_dec(&fq->refcnt); |
110 | fq->last_in |= COMPLETE; | 110 | fq->last_in |= INET_FRAG_COMPLETE; |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
@@ -131,7 +131,7 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f, | |||
131 | struct sk_buff *fp; | 131 | struct sk_buff *fp; |
132 | struct netns_frags *nf; | 132 | struct netns_frags *nf; |
133 | 133 | ||
134 | BUG_TRAP(q->last_in & COMPLETE); | 134 | BUG_TRAP(q->last_in & INET_FRAG_COMPLETE); |
135 | BUG_TRAP(del_timer(&q->timer) == 0); | 135 | BUG_TRAP(del_timer(&q->timer) == 0); |
136 | 136 | ||
137 | /* Release all fragment data. */ | 137 | /* Release all fragment data. */ |
@@ -174,7 +174,7 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f) | |||
174 | read_unlock(&f->lock); | 174 | read_unlock(&f->lock); |
175 | 175 | ||
176 | spin_lock(&q->lock); | 176 | spin_lock(&q->lock); |
177 | if (!(q->last_in & COMPLETE)) | 177 | if (!(q->last_in & INET_FRAG_COMPLETE)) |
178 | inet_frag_kill(q, f); | 178 | inet_frag_kill(q, f); |
179 | spin_unlock(&q->lock); | 179 | spin_unlock(&q->lock); |
180 | 180 | ||
@@ -206,7 +206,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf, | |||
206 | if (qp->net == nf && f->match(qp, arg)) { | 206 | if (qp->net == nf && f->match(qp, arg)) { |
207 | atomic_inc(&qp->refcnt); | 207 | atomic_inc(&qp->refcnt); |
208 | write_unlock(&f->lock); | 208 | write_unlock(&f->lock); |
209 | qp_in->last_in |= COMPLETE; | 209 | qp_in->last_in |= INET_FRAG_COMPLETE; |
210 | inet_frag_put(qp_in, f); | 210 | inet_frag_put(qp_in, f); |
211 | return qp; | 211 | return qp; |
212 | } | 212 | } |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index fcb60e76b234..02ae470fe60c 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -194,7 +194,7 @@ static void ip_expire(unsigned long arg) | |||
194 | 194 | ||
195 | spin_lock(&qp->q.lock); | 195 | spin_lock(&qp->q.lock); |
196 | 196 | ||
197 | if (qp->q.last_in & COMPLETE) | 197 | if (qp->q.last_in & INET_FRAG_COMPLETE) |
198 | goto out; | 198 | goto out; |
199 | 199 | ||
200 | ipq_kill(qp); | 200 | ipq_kill(qp); |
@@ -202,7 +202,7 @@ static void ip_expire(unsigned long arg) | |||
202 | IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT); | 202 | IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT); |
203 | IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); | 203 | IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); |
204 | 204 | ||
205 | if ((qp->q.last_in&FIRST_IN) && qp->q.fragments != NULL) { | 205 | if ((qp->q.last_in & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) { |
206 | struct sk_buff *head = qp->q.fragments; | 206 | struct sk_buff *head = qp->q.fragments; |
207 | struct net *net; | 207 | struct net *net; |
208 | 208 | ||
@@ -301,7 +301,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
301 | int ihl, end; | 301 | int ihl, end; |
302 | int err = -ENOENT; | 302 | int err = -ENOENT; |
303 | 303 | ||
304 | if (qp->q.last_in & COMPLETE) | 304 | if (qp->q.last_in & INET_FRAG_COMPLETE) |
305 | goto err; | 305 | goto err; |
306 | 306 | ||
307 | if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) && | 307 | if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) && |
@@ -327,9 +327,9 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
327 | * or have different end, the segment is corrrupted. | 327 | * or have different end, the segment is corrrupted. |
328 | */ | 328 | */ |
329 | if (end < qp->q.len || | 329 | if (end < qp->q.len || |
330 | ((qp->q.last_in & LAST_IN) && end != qp->q.len)) | 330 | ((qp->q.last_in & INET_FRAG_LAST_IN) && end != qp->q.len)) |
331 | goto err; | 331 | goto err; |
332 | qp->q.last_in |= LAST_IN; | 332 | qp->q.last_in |= INET_FRAG_LAST_IN; |
333 | qp->q.len = end; | 333 | qp->q.len = end; |
334 | } else { | 334 | } else { |
335 | if (end&7) { | 335 | if (end&7) { |
@@ -339,7 +339,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
339 | } | 339 | } |
340 | if (end > qp->q.len) { | 340 | if (end > qp->q.len) { |
341 | /* Some bits beyond end -> corruption. */ | 341 | /* Some bits beyond end -> corruption. */ |
342 | if (qp->q.last_in & LAST_IN) | 342 | if (qp->q.last_in & INET_FRAG_LAST_IN) |
343 | goto err; | 343 | goto err; |
344 | qp->q.len = end; | 344 | qp->q.len = end; |
345 | } | 345 | } |
@@ -438,9 +438,10 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
438 | qp->q.meat += skb->len; | 438 | qp->q.meat += skb->len; |
439 | atomic_add(skb->truesize, &qp->q.net->mem); | 439 | atomic_add(skb->truesize, &qp->q.net->mem); |
440 | if (offset == 0) | 440 | if (offset == 0) |
441 | qp->q.last_in |= FIRST_IN; | 441 | qp->q.last_in |= INET_FRAG_FIRST_IN; |
442 | 442 | ||
443 | if (qp->q.last_in == (FIRST_IN | LAST_IN) && qp->q.meat == qp->q.len) | 443 | if (qp->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && |
444 | qp->q.meat == qp->q.len) | ||
444 | return ip_frag_reasm(qp, prev, dev); | 445 | return ip_frag_reasm(qp, prev, dev); |
445 | 446 | ||
446 | write_lock(&ip4_frags.lock); | 447 | write_lock(&ip4_frags.lock); |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 2a0d698b24d5..ad8066200f9d 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -183,7 +183,7 @@ static void nf_ct_frag6_expire(unsigned long data) | |||
183 | 183 | ||
184 | spin_lock(&fq->q.lock); | 184 | spin_lock(&fq->q.lock); |
185 | 185 | ||
186 | if (fq->q.last_in & COMPLETE) | 186 | if (fq->q.last_in & INET_FRAG_COMPLETE) |
187 | goto out; | 187 | goto out; |
188 | 188 | ||
189 | fq_kill(fq); | 189 | fq_kill(fq); |
@@ -225,7 +225,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, | |||
225 | struct sk_buff *prev, *next; | 225 | struct sk_buff *prev, *next; |
226 | int offset, end; | 226 | int offset, end; |
227 | 227 | ||
228 | if (fq->q.last_in & COMPLETE) { | 228 | if (fq->q.last_in & INET_FRAG_COMPLETE) { |
229 | pr_debug("Allready completed\n"); | 229 | pr_debug("Allready completed\n"); |
230 | goto err; | 230 | goto err; |
231 | } | 231 | } |
@@ -252,11 +252,11 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, | |||
252 | * or have different end, the segment is corrupted. | 252 | * or have different end, the segment is corrupted. |
253 | */ | 253 | */ |
254 | if (end < fq->q.len || | 254 | if (end < fq->q.len || |
255 | ((fq->q.last_in & LAST_IN) && end != fq->q.len)) { | 255 | ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) { |
256 | pr_debug("already received last fragment\n"); | 256 | pr_debug("already received last fragment\n"); |
257 | goto err; | 257 | goto err; |
258 | } | 258 | } |
259 | fq->q.last_in |= LAST_IN; | 259 | fq->q.last_in |= INET_FRAG_LAST_IN; |
260 | fq->q.len = end; | 260 | fq->q.len = end; |
261 | } else { | 261 | } else { |
262 | /* Check if the fragment is rounded to 8 bytes. | 262 | /* Check if the fragment is rounded to 8 bytes. |
@@ -271,7 +271,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, | |||
271 | } | 271 | } |
272 | if (end > fq->q.len) { | 272 | if (end > fq->q.len) { |
273 | /* Some bits beyond end -> corruption. */ | 273 | /* Some bits beyond end -> corruption. */ |
274 | if (fq->q.last_in & LAST_IN) { | 274 | if (fq->q.last_in & INET_FRAG_LAST_IN) { |
275 | pr_debug("last packet already reached.\n"); | 275 | pr_debug("last packet already reached.\n"); |
276 | goto err; | 276 | goto err; |
277 | } | 277 | } |
@@ -383,7 +383,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, | |||
383 | */ | 383 | */ |
384 | if (offset == 0) { | 384 | if (offset == 0) { |
385 | fq->nhoffset = nhoff; | 385 | fq->nhoffset = nhoff; |
386 | fq->q.last_in |= FIRST_IN; | 386 | fq->q.last_in |= INET_FRAG_FIRST_IN; |
387 | } | 387 | } |
388 | write_lock(&nf_frags.lock); | 388 | write_lock(&nf_frags.lock); |
389 | list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list); | 389 | list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list); |
@@ -645,7 +645,8 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) | |||
645 | goto ret_orig; | 645 | goto ret_orig; |
646 | } | 646 | } |
647 | 647 | ||
648 | if (fq->q.last_in == (FIRST_IN|LAST_IN) && fq->q.meat == fq->q.len) { | 648 | if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && |
649 | fq->q.meat == fq->q.len) { | ||
649 | ret_skb = nf_ct_frag6_reasm(fq, dev); | 650 | ret_skb = nf_ct_frag6_reasm(fq, dev); |
650 | if (ret_skb == NULL) | 651 | if (ret_skb == NULL) |
651 | pr_debug("Can't reassemble fragmented packets\n"); | 652 | pr_debug("Can't reassemble fragmented packets\n"); |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 4e1447634f36..7b247e3a16fe 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -202,7 +202,7 @@ static void ip6_frag_expire(unsigned long data) | |||
202 | 202 | ||
203 | spin_lock(&fq->q.lock); | 203 | spin_lock(&fq->q.lock); |
204 | 204 | ||
205 | if (fq->q.last_in & COMPLETE) | 205 | if (fq->q.last_in & INET_FRAG_COMPLETE) |
206 | goto out; | 206 | goto out; |
207 | 207 | ||
208 | fq_kill(fq); | 208 | fq_kill(fq); |
@@ -217,7 +217,7 @@ static void ip6_frag_expire(unsigned long data) | |||
217 | rcu_read_unlock(); | 217 | rcu_read_unlock(); |
218 | 218 | ||
219 | /* Don't send error if the first segment did not arrive. */ | 219 | /* Don't send error if the first segment did not arrive. */ |
220 | if (!(fq->q.last_in&FIRST_IN) || !fq->q.fragments) | 220 | if (!(fq->q.last_in & INET_FRAG_FIRST_IN) || !fq->q.fragments) |
221 | goto out; | 221 | goto out; |
222 | 222 | ||
223 | /* | 223 | /* |
@@ -265,7 +265,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
265 | struct net_device *dev; | 265 | struct net_device *dev; |
266 | int offset, end; | 266 | int offset, end; |
267 | 267 | ||
268 | if (fq->q.last_in & COMPLETE) | 268 | if (fq->q.last_in & INET_FRAG_COMPLETE) |
269 | goto err; | 269 | goto err; |
270 | 270 | ||
271 | offset = ntohs(fhdr->frag_off) & ~0x7; | 271 | offset = ntohs(fhdr->frag_off) & ~0x7; |
@@ -294,9 +294,9 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
294 | * or have different end, the segment is corrupted. | 294 | * or have different end, the segment is corrupted. |
295 | */ | 295 | */ |
296 | if (end < fq->q.len || | 296 | if (end < fq->q.len || |
297 | ((fq->q.last_in & LAST_IN) && end != fq->q.len)) | 297 | ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) |
298 | goto err; | 298 | goto err; |
299 | fq->q.last_in |= LAST_IN; | 299 | fq->q.last_in |= INET_FRAG_LAST_IN; |
300 | fq->q.len = end; | 300 | fq->q.len = end; |
301 | } else { | 301 | } else { |
302 | /* Check if the fragment is rounded to 8 bytes. | 302 | /* Check if the fragment is rounded to 8 bytes. |
@@ -314,7 +314,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
314 | } | 314 | } |
315 | if (end > fq->q.len) { | 315 | if (end > fq->q.len) { |
316 | /* Some bits beyond end -> corruption. */ | 316 | /* Some bits beyond end -> corruption. */ |
317 | if (fq->q.last_in & LAST_IN) | 317 | if (fq->q.last_in & INET_FRAG_LAST_IN) |
318 | goto err; | 318 | goto err; |
319 | fq->q.len = end; | 319 | fq->q.len = end; |
320 | } | 320 | } |
@@ -417,10 +417,11 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
417 | */ | 417 | */ |
418 | if (offset == 0) { | 418 | if (offset == 0) { |
419 | fq->nhoffset = nhoff; | 419 | fq->nhoffset = nhoff; |
420 | fq->q.last_in |= FIRST_IN; | 420 | fq->q.last_in |= INET_FRAG_FIRST_IN; |
421 | } | 421 | } |
422 | 422 | ||
423 | if (fq->q.last_in == (FIRST_IN | LAST_IN) && fq->q.meat == fq->q.len) | 423 | if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && |
424 | fq->q.meat == fq->q.len) | ||
424 | return ip6_frag_reasm(fq, prev, dev); | 425 | return ip6_frag_reasm(fq, prev, dev); |
425 | 426 | ||
426 | write_lock(&ip6_frags.lock); | 427 | write_lock(&ip6_frags.lock); |