Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2018 16:52:52 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338256 - head/sys/dev/xen/netfront
Message-ID:  <201808231652.w7NGqqKJ026291@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Thu Aug 23 16:52:52 2018
New Revision: 338256
URL: https://svnweb.freebsd.org/changeset/base/338256

Log:
  xen/netfront: Ensure curvnet is set
  
  netfront_backend_changed() is called from the xenwatch_thread(), which means
  that the curvnet is not set. We have to set it before we can call things like
  arp_ifinit().
  
  PR:		230845

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

Modified: head/sys/dev/xen/netfront/netfront.c
==============================================================================
--- head/sys/dev/xen/netfront/netfront.c	Thu Aug 23 16:26:03 2018	(r338255)
+++ head/sys/dev/xen/netfront/netfront.c	Thu Aug 23 16:52:52 2018	(r338256)
@@ -962,6 +962,8 @@ netfront_backend_changed(device_t dev, XenbusState new
 
 	DPRINTK("newstate=%d\n", newstate);
 
+	CURVNET_SET(sc->xn_ifp->if_vnet);
+
 	switch (newstate) {
 	case XenbusStateInitialising:
 	case XenbusStateInitialised:
@@ -994,6 +996,8 @@ netfront_backend_changed(device_t dev, XenbusState new
 #endif
 		break;
 	}
+
+	CURVNET_RESTORE();
 }
 
 /**



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