svn commit: r299542 - head/sys/dev/xen/netfront

Roger Pau Monné royger at FreeBSD.org
Thu May 12 16:18:04 UTC 2016


Author: royger
Date: Thu May 12 16:18:02 2016
New Revision: 299542
URL: https://svnweb.freebsd.org/changeset/base/299542

Log:
  xen-netfront: fix feature detection
  
  Current netfront code relies on xs_scanf returning a value < 0 on error,
  which is not right, xs_scanf returns a positive value on error.
  
  MFC after:	3 days
  Tested by:	Stephen Jones <StephenJo at LivingComputerMuseum.org>
  Sponsored by:	Citrix Systems R&D

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==============================================================================
--- head/sys/dev/xen/netfront/netfront.c	Thu May 12 16:14:16 2016	(r299541)
+++ head/sys/dev/xen/netfront/netfront.c	Thu May 12 16:18:02 2016	(r299542)
@@ -2016,7 +2016,7 @@ xn_query_features(struct netfront_info *
 	device_printf(np->xbdev, "backend features:");
 
 	if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev),
-		"feature-sg", NULL, "%d", &val) < 0)
+		"feature-sg", NULL, "%d", &val) != 0)
 		val = 0;
 
 	np->maxfrags = 1;
@@ -2026,7 +2026,7 @@ xn_query_features(struct netfront_info *
 	}
 
 	if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev),
-		"feature-gso-tcpv4", NULL, "%d", &val) < 0)
+		"feature-gso-tcpv4", NULL, "%d", &val) != 0)
 		val = 0;
 
 	np->xn_ifp->if_capabilities &= ~(IFCAP_TSO4|IFCAP_LRO);


More information about the svn-src-all mailing list