]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/if_mib.c
xnu-1456.1.26.tar.gz
[apple/xnu.git] / bsd / net / if_mib.c
index 17e1433bccb0a30a4d18661d4681ed6d8003e44a..b4abc7f16c522a6cc23ecfc92a49b0662e8dbdb4 100644 (file)
@@ -116,6 +116,11 @@ SYSCTL_INT(_net_link_generic_system, OID_AUTO, dlil_input_sanity_check, CTLFLAG_
                    &dlil_input_sanity_check , 0, "Turn on sanity checking in DLIL input");
 #endif
 
+extern int dlil_verbose;
+SYSCTL_INT(_net_link_generic_system, OID_AUTO, dlil_verbose, CTLFLAG_RW,
+           &dlil_verbose, 0, "Log DLIL error messages");
+
+
 static int make_ifmibdata(struct ifnet *, int *, struct sysctl_req *);
 
 
@@ -197,10 +202,13 @@ sysctl_ifdata SYSCTL_HANDLER_ARGS /* XXX bad syntax! */
 
        if (namelen != 2)
                return EINVAL;
-
+       ifnet_head_lock_shared();
        if (name[0] <= 0 || name[0] > if_index ||
-           (ifp = ifindex2ifnet[name[0]]) == NULL)
+           (ifp = ifindex2ifnet[name[0]]) == NULL) {
+               ifnet_head_done();
                return ENOENT;
+       }
+       ifnet_head_done();
 
        ifnet_lock_shared(ifp);