diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inet_fragment.c | 14 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 20 |
2 files changed, 17 insertions, 17 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 62b1f73749dc..e3ebc6608e5d 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -152,8 +152,8 @@ evict_again: | |||
152 | } | 152 | } |
153 | 153 | ||
154 | /* suppress xmit of (icmp) error packet */ | 154 | /* suppress xmit of (icmp) error packet */ |
155 | fq->last_in &= ~INET_FRAG_FIRST_IN; | 155 | fq->flags &= ~INET_FRAG_FIRST_IN; |
156 | fq->last_in |= INET_FRAG_EVICTED; | 156 | fq->flags |= INET_FRAG_EVICTED; |
157 | hlist_del(&fq->list); | 157 | hlist_del(&fq->list); |
158 | hlist_add_head(&fq->list, &expired); | 158 | hlist_add_head(&fq->list, &expired); |
159 | ++evicted; | 159 | ++evicted; |
@@ -289,16 +289,16 @@ void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f) | |||
289 | if (del_timer(&fq->timer)) | 289 | if (del_timer(&fq->timer)) |
290 | atomic_dec(&fq->refcnt); | 290 | atomic_dec(&fq->refcnt); |
291 | 291 | ||
292 | if (!(fq->last_in & INET_FRAG_COMPLETE)) { | 292 | if (!(fq->flags & INET_FRAG_COMPLETE)) { |
293 | fq_unlink(fq, f); | 293 | fq_unlink(fq, f); |
294 | atomic_dec(&fq->refcnt); | 294 | atomic_dec(&fq->refcnt); |
295 | fq->last_in |= INET_FRAG_COMPLETE; | 295 | fq->flags |= INET_FRAG_COMPLETE; |
296 | } | 296 | } |
297 | } | 297 | } |
298 | EXPORT_SYMBOL(inet_frag_kill); | 298 | EXPORT_SYMBOL(inet_frag_kill); |
299 | 299 | ||
300 | static inline void frag_kfree_skb(struct netns_frags *nf, struct inet_frags *f, | 300 | static inline void frag_kfree_skb(struct netns_frags *nf, struct inet_frags *f, |
301 | struct sk_buff *skb) | 301 | struct sk_buff *skb) |
302 | { | 302 | { |
303 | if (f->skb_free) | 303 | if (f->skb_free) |
304 | f->skb_free(skb); | 304 | f->skb_free(skb); |
@@ -311,7 +311,7 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f) | |||
311 | struct netns_frags *nf; | 311 | struct netns_frags *nf; |
312 | unsigned int sum, sum_truesize = 0; | 312 | unsigned int sum, sum_truesize = 0; |
313 | 313 | ||
314 | WARN_ON(!(q->last_in & INET_FRAG_COMPLETE)); | 314 | WARN_ON(!(q->flags & INET_FRAG_COMPLETE)); |
315 | WARN_ON(del_timer(&q->timer) != 0); | 315 | WARN_ON(del_timer(&q->timer) != 0); |
316 | 316 | ||
317 | /* Release all fragment data. */ | 317 | /* Release all fragment data. */ |
@@ -349,7 +349,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf, | |||
349 | if (qp->net == nf && f->match(qp, arg)) { | 349 | if (qp->net == nf && f->match(qp, arg)) { |
350 | atomic_inc(&qp->refcnt); | 350 | atomic_inc(&qp->refcnt); |
351 | spin_unlock(&hb->chain_lock); | 351 | spin_unlock(&hb->chain_lock); |
352 | qp_in->last_in |= INET_FRAG_COMPLETE; | 352 | qp_in->flags |= INET_FRAG_COMPLETE; |
353 | inet_frag_put(qp_in, f); | 353 | inet_frag_put(qp_in, f); |
354 | return qp; | 354 | return qp; |
355 | } | 355 | } |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 634fc31aa243..6fce1ecc5bca 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -185,16 +185,16 @@ static void ip_expire(unsigned long arg) | |||
185 | 185 | ||
186 | spin_lock(&qp->q.lock); | 186 | spin_lock(&qp->q.lock); |
187 | 187 | ||
188 | if (qp->q.last_in & INET_FRAG_COMPLETE) | 188 | if (qp->q.flags & INET_FRAG_COMPLETE) |
189 | goto out; | 189 | goto out; |
190 | 190 | ||
191 | ipq_kill(qp); | 191 | ipq_kill(qp); |
192 | 192 | ||
193 | if (!(qp->q.last_in & INET_FRAG_EVICTED)) | 193 | if (!(qp->q.flags & INET_FRAG_EVICTED)) |
194 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMTIMEOUT); | 194 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMTIMEOUT); |
195 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); | 195 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); |
196 | 196 | ||
197 | if ((qp->q.last_in & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) { | 197 | if ((qp->q.flags & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) { |
198 | struct sk_buff *head = qp->q.fragments; | 198 | struct sk_buff *head = qp->q.fragments; |
199 | const struct iphdr *iph; | 199 | const struct iphdr *iph; |
200 | int err; | 200 | int err; |
@@ -302,7 +302,7 @@ static int ip_frag_reinit(struct ipq *qp) | |||
302 | } while (fp); | 302 | } while (fp); |
303 | sub_frag_mem_limit(&qp->q, sum_truesize); | 303 | sub_frag_mem_limit(&qp->q, sum_truesize); |
304 | 304 | ||
305 | qp->q.last_in = 0; | 305 | qp->q.flags = 0; |
306 | qp->q.len = 0; | 306 | qp->q.len = 0; |
307 | qp->q.meat = 0; | 307 | qp->q.meat = 0; |
308 | qp->q.fragments = NULL; | 308 | qp->q.fragments = NULL; |
@@ -323,7 +323,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
323 | int err = -ENOENT; | 323 | int err = -ENOENT; |
324 | u8 ecn; | 324 | u8 ecn; |
325 | 325 | ||
326 | if (qp->q.last_in & INET_FRAG_COMPLETE) | 326 | if (qp->q.flags & INET_FRAG_COMPLETE) |
327 | goto err; | 327 | goto err; |
328 | 328 | ||
329 | if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) && | 329 | if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) && |
@@ -350,9 +350,9 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
350 | * or have different end, the segment is corrupted. | 350 | * or have different end, the segment is corrupted. |
351 | */ | 351 | */ |
352 | if (end < qp->q.len || | 352 | if (end < qp->q.len || |
353 | ((qp->q.last_in & INET_FRAG_LAST_IN) && end != qp->q.len)) | 353 | ((qp->q.flags & INET_FRAG_LAST_IN) && end != qp->q.len)) |
354 | goto err; | 354 | goto err; |
355 | qp->q.last_in |= INET_FRAG_LAST_IN; | 355 | qp->q.flags |= INET_FRAG_LAST_IN; |
356 | qp->q.len = end; | 356 | qp->q.len = end; |
357 | } else { | 357 | } else { |
358 | if (end&7) { | 358 | if (end&7) { |
@@ -362,7 +362,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
362 | } | 362 | } |
363 | if (end > qp->q.len) { | 363 | if (end > qp->q.len) { |
364 | /* Some bits beyond end -> corruption. */ | 364 | /* Some bits beyond end -> corruption. */ |
365 | if (qp->q.last_in & INET_FRAG_LAST_IN) | 365 | if (qp->q.flags & INET_FRAG_LAST_IN) |
366 | goto err; | 366 | goto err; |
367 | qp->q.len = end; | 367 | qp->q.len = end; |
368 | } | 368 | } |
@@ -471,13 +471,13 @@ found: | |||
471 | qp->ecn |= ecn; | 471 | qp->ecn |= ecn; |
472 | add_frag_mem_limit(&qp->q, skb->truesize); | 472 | add_frag_mem_limit(&qp->q, skb->truesize); |
473 | if (offset == 0) | 473 | if (offset == 0) |
474 | qp->q.last_in |= INET_FRAG_FIRST_IN; | 474 | qp->q.flags |= INET_FRAG_FIRST_IN; |
475 | 475 | ||
476 | if (ip_hdr(skb)->frag_off & htons(IP_DF) && | 476 | if (ip_hdr(skb)->frag_off & htons(IP_DF) && |
477 | skb->len + ihl > qp->q.max_size) | 477 | skb->len + ihl > qp->q.max_size) |
478 | qp->q.max_size = skb->len + ihl; | 478 | qp->q.max_size = skb->len + ihl; |
479 | 479 | ||
480 | if (qp->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && | 480 | if (qp->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && |
481 | qp->q.meat == qp->q.len) { | 481 | qp->q.meat == qp->q.len) { |
482 | unsigned long orefdst = skb->_skb_refdst; | 482 | unsigned long orefdst = skb->_skb_refdst; |
483 | 483 | ||