debuggers.hg

changeset 22282:6e8dd34122e7

MiniOS: Fix continue; in netfront receive loop

To properly ignore some requests through the use of continue;, indexes need to
be updated.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Samuel Thibault <samuel.thibault@ens-lyon.org>
date Tue Oct 12 10:27:56 2010 +0100 (2010-10-12)
parents b8cc53d22545
children 5eee67899140
files extras/mini-os/netfront.c
line diff
     1.1 --- a/extras/mini-os/netfront.c	Mon Oct 11 17:54:53 2010 +0100
     1.2 +++ b/extras/mini-os/netfront.c	Tue Oct 12 10:27:56 2010 +0100
     1.3 @@ -105,9 +105,9 @@ moretodo:
     1.4      rmb(); /* Ensure we see queued responses up to 'rp'. */
     1.5      cons = dev->rx.rsp_cons;
     1.6  
     1.7 -    nr_consumed = 0;
     1.8 -    some = 0;
     1.9 -    while ((cons != rp) && !some)
    1.10 +    for (nr_consumed = 0, some = 0;
    1.11 +         (cons != rp) && !some;
    1.12 +         nr_consumed++, cons++)
    1.13      {
    1.14          struct net_buffer* buf;
    1.15          unsigned char* page;
    1.16 @@ -146,10 +146,6 @@ moretodo:
    1.17  #endif
    1.18  		dev->netif_rx(page+rx->offset,rx->status);
    1.19          }
    1.20 -
    1.21 -        nr_consumed++;
    1.22 -
    1.23 -        ++cons;
    1.24      }
    1.25      dev->rx.rsp_cons=cons;
    1.26