From owner-svn-src-all@freebsd.org Thu May 12 16:18:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B844B37649; Thu, 12 May 2016 16:18:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0898910B8; Thu, 12 May 2016 16:18:03 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CGI3Gk067225; Thu, 12 May 2016 16:18:03 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CGI3mo067224; Thu, 12 May 2016 16:18:03 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605121618.u4CGI3mo067224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 12 May 2016 16:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299542 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2016 16:18:04 -0000 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 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);