The branch main has been updated by zlei:

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

commit 2472f4dbe93049d70afe0897f66f9651b67672e9
Author:     Zhenlei Huang <z...@freebsd.org>
AuthorDate: 2025-03-05 04:57:30 +0000
Commit:     Zhenlei Huang <z...@freebsd.org>
CommitDate: 2025-03-05 04:57:30 +0000

    udp: Do not recursively enter net epoch
    
    The only caller udp_send() has already entered net epoch before invoking
    udp_v4mapped_pktinfo().
    
    No functional change intended.
    
    This partially reverts commit d74b7baeb0d4 (ifnet_byindex() actually
    requires network epoch).
    
    Reviewed by:    ae, glebius
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D49227
---
 sys/netinet/udp_usrreq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 2c68d0880100..b3d980956b66 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1040,6 +1040,8 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct 
sockaddr_in * src,
        struct in6_pktinfo *pktinfo;
        struct in_addr ia;
 
+       NET_EPOCH_ASSERT();
+
        if ((flags & PRUS_IPV6) == 0)
                return (0);
 
@@ -1061,11 +1063,7 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct 
sockaddr_in * src,
 
        /* Validate the interface index if specified. */
        if (pktinfo->ipi6_ifindex) {
-               struct epoch_tracker et;
-
-               NET_EPOCH_ENTER(et);
                ifp = ifnet_byindex(pktinfo->ipi6_ifindex);
-               NET_EPOCH_EXIT(et);     /* XXXGL: unsafe ifp */
                if (ifp == NULL)
                        return (ENXIO);
        } else

Reply via email to