From e32d93954d3d3e23f081c9248436e8f866631e5f Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Tue, 2 Jul 2013 16:39:12 +0000 Subject: [PATCH] Fix a panic when leaving MC group in a kernel with VIMAGE enabled. in_leavegroup() is called from an asynchronous task, and igmp_change_state() requires that curvnet is set by the caller. --- sys/netinet/in_mcast.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index b0d53b02ab54..31f2fe1ca4f6 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1236,7 +1236,9 @@ in_leavegroup_locked(struct in_multi *inm, /*const*/ struct in_mfilter *imf) KASSERT(error == 0, ("%s: failed to merge inm state", __func__)); CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); + CURVNET_SET(inm->inm_ifp->if_vnet); error = igmp_change_state(inm); + CURVNET_RESTORE(); if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__);