Author: royger
Date: Fri Jul 29 16:33:45 2016
New Revision: 303488
URL: https://svnweb.freebsd.org/changeset/base/303488

Log:
  xen-netfront: fix trying to send packets with disconnected netfront
  
  In certain circumstances xn_txq_mq_start might be called with num_queues ==
  0 during the resume phase after a migration, which can trigger a KASSERT.
  Fix this by making sure the carrier is on before trying to transmit, or else
  return that the queues are full.
  
  Just as a note, I haven't been able to reproduce this crash on my test
  systems, but I still think it's possible and worth fixing.
  
  Reported by:          Karl Pielorz <[email protected]>
  Sponsored by:         Citrix Systems R&D
  MFC after:            5 days
  Reviewed by:          Wei Liu <[email protected]>
  Differential revision:        https://reviews.freebsd.org/D7349

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

Modified: head/sys/dev/xen/netfront/netfront.c
==============================================================================
--- head/sys/dev/xen/netfront/netfront.c        Fri Jul 29 16:28:51 2016        
(r303487)
+++ head/sys/dev/xen/netfront/netfront.c        Fri Jul 29 16:33:45 2016        
(r303488)
@@ -2157,6 +2157,9 @@ xn_txq_mq_start(struct ifnet *ifp, struc
        np = ifp->if_softc;
        npairs = np->num_queues;
 
+       if (!netfront_carrier_ok(np))
+               return (ENOBUFS);
+
        KASSERT(npairs != 0, ("called with 0 available queues"));
 
        /* check if flowid is set */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to