inet: frags: rename last_in to flags
The last_in field has been used to store various flags different from first/last frag in so give it a more descriptive name: flags. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
d2373862b3
commit
06aa8b8a03
@@ -99,7 +99,7 @@ static void lowpan_frag_expire(unsigned long data)
|
||||
|
||||
spin_lock(&fq->q.lock);
|
||||
|
||||
if (fq->q.last_in & INET_FRAG_COMPLETE)
|
||||
if (fq->q.flags & INET_FRAG_COMPLETE)
|
||||
goto out;
|
||||
|
||||
inet_frag_kill(&fq->q, &lowpan_frags);
|
||||
@@ -142,7 +142,7 @@ static int lowpan_frag_queue(struct lowpan_frag_queue *fq,
|
||||
struct net_device *dev;
|
||||
int end, offset;
|
||||
|
||||
if (fq->q.last_in & INET_FRAG_COMPLETE)
|
||||
if (fq->q.flags & INET_FRAG_COMPLETE)
|
||||
goto err;
|
||||
|
||||
offset = lowpan_cb(skb)->d_offset << 3;
|
||||
@@ -154,14 +154,14 @@ static int lowpan_frag_queue(struct lowpan_frag_queue *fq,
|
||||
* or have different end, the segment is corrupted.
|
||||
*/
|
||||
if (end < fq->q.len ||
|
||||
((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len))
|
||||
((fq->q.flags & INET_FRAG_LAST_IN) && end != fq->q.len))
|
||||
goto err;
|
||||
fq->q.last_in |= INET_FRAG_LAST_IN;
|
||||
fq->q.flags |= INET_FRAG_LAST_IN;
|
||||
fq->q.len = end;
|
||||
} else {
|
||||
if (end > fq->q.len) {
|
||||
/* Some bits beyond end -> corruption. */
|
||||
if (fq->q.last_in & INET_FRAG_LAST_IN)
|
||||
if (fq->q.flags & INET_FRAG_LAST_IN)
|
||||
goto err;
|
||||
fq->q.len = end;
|
||||
}
|
||||
@@ -201,13 +201,13 @@ found:
|
||||
if (frag_type == LOWPAN_DISPATCH_FRAG1) {
|
||||
/* Calculate uncomp. 6lowpan header to estimate full size */
|
||||
fq->q.meat += lowpan_uncompress_size(skb, NULL);
|
||||
fq->q.last_in |= INET_FRAG_FIRST_IN;
|
||||
fq->q.flags |= INET_FRAG_FIRST_IN;
|
||||
} else {
|
||||
fq->q.meat += skb->len;
|
||||
}
|
||||
add_frag_mem_limit(&fq->q, skb->truesize);
|
||||
|
||||
if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
|
||||
if (fq->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
|
||||
fq->q.meat == fq->q.len) {
|
||||
int res;
|
||||
unsigned long orefdst = skb->_skb_refdst;
|
||||
|
Reference in New Issue
Block a user