summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/net/if.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-07-09 11:14:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-07-09 14:45:47 +0200
commit5283630d2c9d40deb0183696d278e02644fe4326 (patch)
treed5695aea058ed05d4d9a4b84b5cb9986aaefd23f /freebsd/sys/net/if.c
parentEPOCH(9): Add epoch_drain_callbacks() (diff)
downloadrtems-libbsd-5283630d2c9d40deb0183696d278e02644fe4326.tar.bz2
Update to FreeBSD stable/12 2019-07-09
Git mirror commit 3427c3416aa3c0f25124070959cca78024b94d85.
Diffstat (limited to 'freebsd/sys/net/if.c')
-rw-r--r--freebsd/sys/net/if.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/freebsd/sys/net/if.c b/freebsd/sys/net/if.c
index 5f0329fd..a9c28263 100644
--- a/freebsd/sys/net/if.c
+++ b/freebsd/sys/net/if.c
@@ -1109,6 +1109,15 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
curvnet->vnet_ifcnt--;
#endif
epoch_wait_preempt(net_epoch_preempt);
+
+ /*
+ * Ensure all pending EPOCH(9) callbacks have been executed. This
+ * fixes issues about late destruction of multicast options
+ * which lead to leave group calls, which in turn access the
+ * belonging ifnet structure:
+ */
+ epoch_drain_callbacks(net_epoch_preempt);
+
/*
* In any case (destroy or vmove) detach us from the groups
* and remove/wait for pending events on the taskq.