svn commit: r283764 - projects/ifnet/sys/net

Gleb Smirnoff glebius at FreeBSD.org
Sat May 30 08:01:17 UTC 2015


Author: glebius
Date: Sat May 30 08:01:16 2015
New Revision: 283764
URL: https://svnweb.freebsd.org/changeset/base/283764

Log:
  Fix an error I made in r283655. We need to sleep while we DON'T have an mbuf.
  
  Submitted by:	Tiwei Bie <btw mail.ustc.edu.cn>

Modified:
  projects/ifnet/sys/net/if_tap.c

Modified: projects/ifnet/sys/net/if_tap.c
==============================================================================
--- projects/ifnet/sys/net/if_tap.c	Sat May 30 04:49:19 2015	(r283763)
+++ projects/ifnet/sys/net/if_tap.c	Sat May 30 08:01:16 2015	(r283764)
@@ -888,7 +888,7 @@ tapread(struct cdev *dev, struct uio *ui
 	tp->tap_flags &= ~TAP_RWAIT;
 
 	/* sleep until we get a packet */
-	while ((m = mbufq_dequeue(&tp->tap_queue)) != NULL) {
+	while ((m = mbufq_dequeue(&tp->tap_queue)) == NULL) {
 		if (flag & O_NONBLOCK) {
 			mtx_unlock(&tp->tap_mtx);
 			return (EWOULDBLOCK);


More information about the svn-src-projects mailing list