Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 May 2016 16:18:03 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299542 - head/sys/dev/xen/netfront
Message-ID:  <201605121618.u4CGI3mo067224@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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);



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