Index: sys/net/if.c =================================================================== --- sys/net/if.c +++ sys/net/if.c @@ -1129,6 +1129,17 @@ curvnet->vnet_ifcnt--; #endif epoch_wait_preempt(net_epoch_preempt); + + /* + * XXX EPOCH callbacks are run by the system timer. + * Wait 4 ticks to ensure all pending callbacks have + * been executed. This fixes issues about late + * destruction of multicast options which will + * cause leave group calls, which in turn access + * the belonging ifnet structure. + */ + pause("W", 4); + /* * In any case (destroy or vmove) detach us from the groups * and remove/wait for pending events on the taskq.