-/* $OpenBSD: sys_socket.c,v 1.54 2022/09/02 13:12:31 mvs Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.55 2022/11/08 11:25:01 kn Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
* different entry since a socket's unnecessary
*/
if (IOCGROUP(cmd) == 'i') {
- KERNEL_LOCK();
error = ifioctl(so, cmd, data, p);
- KERNEL_UNLOCK();
return (error);
}
if (IOCGROUP(cmd) == 'r')
-/* $OpenBSD: if.c,v 1.665 2022/09/08 10:22:06 kn Exp $ */
+/* $OpenBSD: if.c,v 1.666 2022/11/08 11:25:01 kn Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
case SIOCIFCREATE:
if ((error = suser(p)) != 0)
return (error);
+ KERNEL_LOCK();
error = if_clone_create(ifr->ifr_name, 0);
+ KERNEL_UNLOCK();
return (error);
case SIOCIFDESTROY:
if ((error = suser(p)) != 0)
return (error);
+ KERNEL_LOCK();
error = if_clone_destroy(ifr->ifr_name);
+ KERNEL_UNLOCK();
return (error);
case SIOCSIFGATTR:
if ((error = suser(p)) != 0)
return (error);
+ KERNEL_LOCK();
NET_LOCK();
error = if_setgroupattribs(data);
NET_UNLOCK();
+ KERNEL_UNLOCK();
return (error);
case SIOCGIFCONF:
case SIOCIFGCLONERS:
case SIOCGIFRDOMAIN:
case SIOCGIFGROUP:
case SIOCGIFLLPRIO:
- return (ifioctl_get(cmd, data));
+ KERNEL_LOCK();
+ error = ifioctl_get(cmd, data);
+ KERNEL_UNLOCK();
+ return (error);
}
+ KERNEL_LOCK();
+
ifp = if_unit(ifr->ifr_name);
- if (ifp == NULL)
+ if (ifp == NULL) {
+ KERNEL_UNLOCK();
return (ENXIO);
+ }
oif_flags = ifp->if_flags;
oif_xflags = ifp->if_xflags;
if (((oif_flags ^ ifp->if_flags) & IFF_UP) != 0)
getmicrotime(&ifp->if_lastchange);
+ KERNEL_UNLOCK();
+
if_put(ifp);
return (error);