Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Mar 2013 05:40:29 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248368 - head/usr.sbin/bhyve
Message-ID:  <201303160540.r2G5eTlC025783@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Sat Mar 16 05:40:29 2013
New Revision: 248368
URL: http://svnweb.freebsd.org/changeset/base/248368

Log:
  Change the type of 'ndesc' from 'int' to 'uint16_t' so that descriptor index
  wraparound is handled correctly.
  
  The gory details are available here:
  http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-March/001119.html
  
  This fixes a regression introduced in r247871.
  
  Pointed out by:	Bruce Evans, Chris Torek

Modified:
  head/usr.sbin/bhyve/pci_virtio_net.c

Modified: head/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_net.c	Sat Mar 16 04:08:01 2013	(r248367)
+++ head/usr.sbin/bhyve/pci_virtio_net.c	Sat Mar 16 05:40:29 2013	(r248368)
@@ -170,7 +170,7 @@ pci_vtnet_iosize(struct pci_devinst *pi)
 static int
 hq_num_avail(struct vring_hqueue *hq)
 {
-	int ndesc;
+	uint16_t ndesc;
 
 	/*
 	 * We're just computing (a-b) in GF(216).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303160540.r2G5eTlC025783>