]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
MiniOS: Fix continue; in netfront receive loop
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 12 Oct 2010 09:27:56 +0000 (10:27 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 12 Oct 2010 09:27:56 +0000 (10:27 +0100)
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>

netfront.c

index 5674c4ae0f3fe1a2f4edd8350238f0e687525b41..ade329ee4597f1f04b955973ecea612637871a16 100644 (file)
@@ -105,9 +105,9 @@ moretodo:
     rmb(); /* Ensure we see queued responses up to 'rp'. */
     cons = dev->rx.rsp_cons;
 
-    nr_consumed = 0;
-    some = 0;
-    while ((cons != rp) && !some)
+    for (nr_consumed = 0, some = 0;
+         (cons != rp) && !some;
+         nr_consumed++, cons++)
     {
         struct net_buffer* buf;
         unsigned char* page;
@@ -146,10 +146,6 @@ moretodo:
 #endif
                dev->netif_rx(page+rx->offset,rx->status);
         }
-
-        nr_consumed++;
-
-        ++cons;
     }
     dev->rx.rsp_cons=cons;