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 <stephe...@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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to