git: e3044071dec1 - main - in6p_set_multicast_if(): fix malloc(M_WAITOK) with epoch

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Mon, 06 Dec 2021 22:36:04 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=e3044071dec1d752a7103b5ae55fe3cff2f5b957

commit e3044071dec1d752a7103b5ae55fe3cff2f5b957
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2021-12-06 22:33:23 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2021-12-06 22:33:23 +0000

    in6p_set_multicast_if(): fix malloc(M_WAITOK) with epoch
    
    Fixes:  d74b7baeb0d4
---
 sys/netinet6/in6_mcast.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
index b1b161ace1b8..d0f8186e75c7 100644
--- a/sys/netinet6/in6_mcast.c
+++ b/sys/netinet6/in6_mcast.c
@@ -2454,9 +2454,9 @@ in6p_set_multicast_if(struct inpcb *inp, struct sockopt *sopt)
 			return (EADDRNOTAVAIL);
 		}
 	}
+	NET_EPOCH_EXIT(et);	/* XXXGL: unsafe ifp */
 	imo = in6p_findmoptions(inp);
-	imo->im6o_multicast_ifp = ifp;	/* XXXGL: reference?! */
-	NET_EPOCH_EXIT(et);
+	imo->im6o_multicast_ifp = ifp;
 	INP_WUNLOCK(inp);
 
 	return (0);