All interface ioctls always run with the kernel lock anyway, so this
doesn't make a difference, except that it reflects how ifnetlist is not
modified.

OK?

diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index a15820420ef..16006c4c102 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -204,16 +204,16 @@ loop_clone_destroy(struct ifnet *ifp)
                        return (EPERM);
 
                /* if there is any other interface in this rdomain, deny */
-               NET_LOCK();
+               NET_LOCK_SHARED();
                TAILQ_FOREACH(p, &ifnetlist, if_list) {
                        if (p->if_rdomain != ifp->if_rdomain)
                                continue;
                        if (p->if_index == ifp->if_index)
                                continue;
-                       NET_UNLOCK();
+                       NET_UNLOCK_SHARED();
                        return (EBUSY);
                }
-               NET_UNLOCK();
+               NET_UNLOCK_SHARED();
 
                rdomain = ifp->if_rdomain;
        }

Reply via email to