git: 49cad3daf2a3 - main - carp: carp_master_down_locked() requires net epoch

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Thu, 16 Mar 2023 10:08:10 UTC
The branch main has been updated by zlei:

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

commit 49cad3daf2a3abe8270f71ee5b15b8990a19529d
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-03-16 10:00:13 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-03-16 10:07:03 +0000

    carp: carp_master_down_locked() requires net epoch
    
    Reviewed by:    kp
    Fixes:          1d126e9b9474 carp: Widen epoch coverage
    MFC after:      1 day
    Differential Revision:  https://reviews.freebsd.org/D39113
---
 sys/netinet/ip_carp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 22b256238774..1b8b10b06168 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1728,6 +1728,7 @@ carp_carprcp(struct carpreq *carpr, struct carp_softc *sc, int priv)
 int
 carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td)
 {
+	struct epoch_tracker et;
 	struct carpreq carpr;
 	struct ifnet *ifp;
 	struct carp_softc *sc = NULL;
@@ -1812,8 +1813,10 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td)
 				carp_delroute(sc);
 				break;
 			case MASTER:
+				NET_EPOCH_ENTER(et);
 				carp_master_down_locked(sc,
 				    "user requested via ifconfig");
+				NET_EPOCH_EXIT(et);
 				break;
 			default:
 				break;