summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2020-05-27 11:19:28 +0000
committermpi <mpi@openbsd.org>2020-05-27 11:19:28 +0000
commit4d5cbc65b3f249a15784c3b64c2933d8466f7caa (patch)
tree3c8cef075a218806de25bcd64f3d244f2ba45dc3 /sys/netinet
parentRemove unneeded <stddef.h> (diff)
downloadwireguard-openbsd-4d5cbc65b3f249a15784c3b64c2933d8466f7caa.tar.xz
wireguard-openbsd-4d5cbc65b3f249a15784c3b64c2933d8466f7caa.zip
Document the various flavors of NET_LOCK() and rename the reader version.
Since our last concurrency mistake only ioctl(2) ans sysctl(2) code path take the reader lock. This is mostly for documentation purpose as long as the softnet thread is converted back to use a read lock. dlg@ said that comments should be good enough. ok sashan@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in.c6
-rw-r--r--sys/netinet/ip_mroute.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index b494b72e844..a7c3b7724b7 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.169 2020/03/15 05:34:13 visa Exp $ */
+/* $OpenBSD: in.c,v 1.170 2020/05/27 11:19:28 mpi Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -569,7 +569,7 @@ in_ioctl_get(u_long cmd, caddr_t data, struct ifnet *ifp)
return (error);
}
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family != AF_INET)
@@ -620,7 +620,7 @@ in_ioctl_get(u_long cmd, caddr_t data, struct ifnet *ifp)
}
err:
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
return (error);
}
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index c6aae18b8db..3cefb2a2596 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_mroute.c,v 1.129 2020/03/15 05:34:13 visa Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.130 2020/05/27 11:19:29 mpi Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
@@ -267,16 +267,16 @@ mrt_ioctl(struct socket *so, u_long cmd, caddr_t data)
else
switch (cmd) {
case SIOCGETVIFCNT:
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
error = get_vif_cnt(inp->inp_rtableid,
(struct sioc_vif_req *)data);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
break;
case SIOCGETSGCNT:
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
error = get_sg_cnt(inp->inp_rtableid,
(struct sioc_sg_req *)data);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
break;
default:
error = ENOTTY;