Page MenuHomeFreeBSD

D62077.1795756083.diff
No OneTemporary

Authored By
Unknown
Size
729 B
Referenced Files
None
Subscribers
None

D62077.1795756083.diff

diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1472,23 +1472,26 @@
/*
* XXX: This KPI should not expose ifg_group. therefore the current
* implementation is questionable and may change in the future.
+ *
+ * The callback runs in the network epoch and must not sleep.
*/
int
if_foreach_group(struct ifnet *ifp, if_foreach_group_cb_t cb, void *cb_arg)
{
+ struct epoch_tracker et;
struct ifg_list *ifgl;
int error;
MPASS(cb);
error = 0;
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
CK_STAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) {
error = cb(ifgl->ifgl_group, cb_arg);
if (error != 0)
break;
}
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
return (error);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 27, 5:08 AM (22 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42033477
Default Alt Text
D62077.1795756083.diff (729 B)

Event Timeline