Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Relax a lock check in if_mcast_op unless NET_MPSAFE



details:   https://anonhg.NetBSD.org/src/rev/48207cede861
branches:  trunk
changeset: 362198:48207cede861
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu May 31 02:10:23 2018 +0000

description:
Relax a lock check in if_mcast_op unless NET_MPSAFE

It seems that there remain some paths that don't satisfy the constraint that is
required only if NET_MPSAFE.  So don't check it by default.

One known path is nd6_rtrequest => in6_addmulti => if_mcast_op, which is not
easy to address.

diffstat:

 sys/net/if.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 2d2d2afbd0b9 -r 48207cede861 sys/net/if.c
--- a/sys/net/if.c      Thu May 31 00:25:38 2018 +0000
+++ b/sys/net/if.c      Thu May 31 02:10:23 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.424 2018/05/24 05:27:29 msaitoh Exp $ */
+/*     $NetBSD: if.c,v 1.425 2018/05/31 02:10:23 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.424 2018/05/24 05:27:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.425 2018/05/31 02:10:23 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -3595,10 +3595,13 @@
        int rc;
        struct ifreq ifr;
 
+       /* There remain some paths that don't hold IFNET_LOCK yet */
+#ifdef NET_MPSAFE
        /* CARP and MROUTING still don't deal with the lock yet */
 #if (!defined(NCARP) || (NCARP == 0)) && !defined(MROUTING)
        KASSERT(IFNET_LOCKED(ifp));
 #endif
+#endif
        if (ifp->if_mcastop != NULL)
                rc = (*ifp->if_mcastop)(ifp, cmd, sa);
        else {



Home | Main Index | Thread Index | Old Index