Fixed receiving multiple frames in generic device.
authorFlorian Pose <fp@igh-essen.com>
Mon, 09 Nov 2009 10:29:29 +0100
changeset 1559 1b3a89f6dc29
parent 1558 55213fcc93a6
child 1560 0ca50da62c52
Fixed receiving multiple frames in generic device.
devices/generic.c
--- a/devices/generic.c	Mon Nov 09 10:21:18 2009 +0100
+++ b/devices/generic.c	Mon Nov 09 10:29:29 2009 +0100
@@ -314,11 +314,11 @@
     struct kvec iov;
     int ret, budget = 10; // FIXME
 
-    iov.iov_base = dev->rx_buf;
-    iov.iov_len = EC_GEN_RX_BUF_SIZE;
-    memset(&msg, 0, sizeof(msg));
-
     do {
+        iov.iov_base = dev->rx_buf;
+        iov.iov_len = EC_GEN_RX_BUF_SIZE;
+        memset(&msg, 0, sizeof(msg));
+
         ret = kernel_recvmsg(dev->socket, &msg, &iov, 1, iov.iov_len,
                 MSG_DONTWAIT);
         if (ret > 0) {