Needs to be initialized in per-virtio loop.

Signed-off-by: Barret Rhoden <[email protected]>
---
 user/vmm/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/user/vmm/virtio_net.c b/user/vmm/virtio_net.c
index 6201acb8358d..18687e04e87c 100644
--- a/user/vmm/virtio_net.c
+++ b/user/vmm/virtio_net.c
@@ -172,7 +172,7 @@ void net_transmitq_fn(void *_vq)
        void *stripped;
        int ret;
        int fd = open(data_path, O_RDWR);
-       int bytestostrip = VIRTIO_HEADER_SIZE;
+       int bytestostrip;
 
        if (fd == -1)
                VIRTIO_DEV_ERRX(vq->vqdev, "Could not open data file for 
ether1.");
@@ -201,6 +201,7 @@ void net_transmitq_fn(void *_vq)
                 */
 
                /* Find the beginning of the ethernet frame. */
+               bytestostrip = VIRTIO_HEADER_SIZE;
                for (int i = 0; i < olen; i++) {
                        /* This conditional also catches cases when iov_len is 
0 */
                        if (iov[i].iov_len <= bytestostrip) {
-- 
2.8.0.rc3.226.g39d4020

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to