[Bug 230845] VIMAGE regression: breaks netfront suspend/resume
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Aug 23 16:09:11 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230845
Kristof Provost <kp at freebsd.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kp at freebsd.org
--- Comment #1 from Kristof Provost <kp at freebsd.org> ---
This likely means you wound up calling arp_ifnet() without a curvnet set.
That's important context for basically all networking operations, but it's not
going to be set when called from a kernel thread, as appears to be the case
here.
Usually all you have to do is ensure that the correct vnet is set.
This is untested (and may not even compile), but might fix it:
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index ba8ac3caf7f..12938354f9c 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -962,6 +962,8 @@ netfront_backend_changed(device_t dev, XenbusState
newstate)
DPRINTK("newstate=%d\n", newstate);
+ CURVNET_SET(sc->xn_ifp->vnet);
+
switch (newstate) {
case XenbusStateInitialising:
case XenbusStateInitialised:
@@ -994,6 +996,8 @@ netfront_backend_changed(device_t dev, XenbusState
newstate)
#endif
break;
}
+
+ CURVNET_RESTORE();
}
/**
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-net
mailing list