Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178083714
D62156.1795911594.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62156.1795911594.diff
View Options
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -5789,9 +5789,17 @@
return (0);
fail_detach:
+ /*
+ * The interface has been visible since ether_ifattach(), which runs
+ * without the context lock, so it may already be running or an ioctl
+ * may be waiting to start it. As in iflib_device_deregister(), mark
+ * the context inactive before dropping the lock so that nothing can
+ * start it from now on.
+ */
STATE_LOCK(ctx);
ctx->ifc_flags |= IFC_IN_DETACH;
STATE_UNLOCK(ctx);
+ ctx->ifc_pm_state = IFLIB_PM_SUSPENDING;
/* Tasks may need the context lock; ether_ifdetach() may sleep. */
CTX_UNLOCK(ctx);
taskqueue_drain_all(ctx->ifc_tq);
@@ -5811,6 +5819,13 @@
#endif
ether_ifdetach(ctx->ifc_ifp);
CTX_LOCK(ctx);
+ /*
+ * Stop the interface if it was started, or failed to start, before
+ * the context was marked inactive.
+ */
+ if (ctx->ifc_datapath_state != IFLIB_DP_UNKNOWN &&
+ ctx->ifc_datapath_state != IFLIB_DP_STOPPED)
+ iflib_stop(ctx);
goto fail_cleanup_detaching;
fail_cleanup:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 29, 12:19 AM (23 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42078821
Default Alt Text
D62156.1795911594.diff (1 KB)
Attached To
Mode
D62156: iflib: Stop an interface started during a failed registration
Attached
Detach File
Event Timeline