As netintro(4) explains, this copies a bunch of data from the global
interface list its per-interface address lists.

All of this is never written to by ifconf(), protected by the net lock
and documented as such in the struct comments already.

Feedback? OK?

diff --git a/sys/net/if.c b/sys/net/if.c
index f3697b78aed..5dd40f97518 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2382,11 +2382,9 @@ ifioctl_get(u_long cmd, caddr_t data)
 
        switch(cmd) {
        case SIOCGIFCONF:
-               KERNEL_LOCK();
                NET_LOCK_SHARED();
                error = ifconf(data);
                NET_UNLOCK_SHARED();
-               KERNEL_UNLOCK();
                return (error);
        case SIOCIFGCLONERS:
                error = if_clone_list((struct if_clonereq *)data);

Reply via email to