[Bug 230845] VIMAGE regression: breaks netfront suspend/resume

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 230845] VIMAGE regression: breaks netfront suspend/resume

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230845

Kristof Provost <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Kristof Provost <[hidden email]> ---
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 the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "[hidden email]"