diff options
author | 2017-08-11 21:24:19 +0000 | |
---|---|---|
committer | 2017-08-11 21:24:19 +0000 | |
commit | aa28b9a6d024fc39940a8bf6e59c28dbaafc6950 (patch) | |
tree | ad38cdfb637269384ad7ff4acea0c6e8e71932a7 /sys/kern | |
parent | Be consistent with goto labels, failure flag and use of FAIL macro. (diff) | |
download | wireguard-openbsd-aa28b9a6d024fc39940a8bf6e59c28dbaafc6950.tar.xz wireguard-openbsd-aa28b9a6d024fc39940a8bf6e59c28dbaafc6950.zip |
Remove NET_LOCK()'s argument.
Tested by Hrvoje Popovski, ok bluhm@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 7 | ||||
-rw-r--r-- | sys/kern/sys_socket.c | 6 | ||||
-rw-r--r-- | sys/kern/uipc_domain.c | 20 | ||||
-rw-r--r-- | sys/kern/uipc_socket2.c | 8 |
4 files changed, 20 insertions, 21 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 7b71ccfde26..ae07c12e8e9 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.329 2017/06/20 14:11:46 gerhard Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.330 2017/08/11 21:24:19 mpi Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1302,9 +1302,8 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, extern struct inpcbtable rawin6pcbtable; #endif struct inpcb *inp; - int s; - NET_LOCK(s); + NET_LOCK(); TAILQ_FOREACH(inp, &tcbtable.inpt_queue, inp_queue) FILLSO(inp->inp_socket); TAILQ_FOREACH(inp, &udbtable.inpt_queue, inp_queue) @@ -1316,7 +1315,7 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, inp_queue) FILLSO(inp->inp_socket); #endif - NET_UNLOCK(s); + NET_UNLOCK(); } fp = LIST_FIRST(&filehead); /* don't FREF when f_count == 0 to avoid race in fdrop() */ diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index d842d0bd5c1..e73fc3f5603 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_socket.c,v 1.32 2017/07/24 09:29:15 mpi Exp $ */ +/* $OpenBSD: sys_socket.c,v 1.33 2017/08/11 21:24:19 mpi Exp $ */ /* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */ /* @@ -125,9 +125,9 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p) * different entry since a socket's unnecessary */ if (IOCGROUP(cmd) == 'i') { - NET_LOCK(s); + NET_LOCK(); error = ifioctl(so, cmd, data, p); - NET_UNLOCK(s); + NET_UNLOCK(); return (error); } if (IOCGROUP(cmd) == 'r') diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index ce7091b540c..b2a43a41cd5 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_domain.c,v 1.51 2017/05/27 08:02:40 claudio Exp $ */ +/* $OpenBSD: uipc_domain.c,v 1.52 2017/08/11 21:24:19 mpi Exp $ */ /* $NetBSD: uipc_domain.c,v 1.14 1996/02/09 19:00:44 christos Exp $ */ /* @@ -165,7 +165,7 @@ net_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, { struct domain *dp; struct protosw *pr; - int s, error, family, protocol; + int error, family, protocol; /* * All sysctl names at this level are nonterminal. @@ -207,10 +207,10 @@ net_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, protocol = name[1]; for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_protocol == protocol && pr->pr_sysctl) { - NET_LOCK(s); + NET_LOCK(); error = (*pr->pr_sysctl)(name + 2, namelen - 2, oldp, oldlenp, newp, newlen); - NET_UNLOCK(s); + NET_UNLOCK(); return (error); } return (ENOPROTOOPT); @@ -238,15 +238,15 @@ pfslowtimo(void *arg) struct timeout *to = (struct timeout *)arg; struct domain *dp; struct protosw *pr; - int i, s; + int i; - NET_LOCK(s); + NET_LOCK(); for (i = 0; (dp = domains[i]) != NULL; i++) { for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_slowtimo) (*pr->pr_slowtimo)(); } - NET_UNLOCK(s); + NET_UNLOCK(); timeout_add_msec(to, 500); } @@ -256,14 +256,14 @@ pffasttimo(void *arg) struct timeout *to = (struct timeout *)arg; struct domain *dp; struct protosw *pr; - int i, s; + int i; - NET_LOCK(s); + NET_LOCK(); for (i = 0; (dp = domains[i]) != NULL; i++) { for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_fasttimo) (*pr->pr_fasttimo)(); } - NET_UNLOCK(s); + NET_UNLOCK(); timeout_add_msec(to, 200); } diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index edfdc993bb9..5fd36ea8156 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.85 2017/07/27 12:05:36 mpi Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.86 2017/08/11 21:24:19 mpi Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -276,12 +276,12 @@ socantrcvmore(struct socket *so) int solock(struct socket *so) { - int s; + int s = 0; if ((so->so_proto->pr_domain->dom_family != PF_LOCAL) && (so->so_proto->pr_domain->dom_family != PF_ROUTE) && (so->so_proto->pr_domain->dom_family != PF_KEY)) - NET_LOCK(s); + NET_LOCK(); else s = -42; @@ -292,7 +292,7 @@ void sounlock(int s) { if (s != -42) - NET_UNLOCK(s); + NET_UNLOCK(); } void |