summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
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/netinet6
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/netinet6')
-rw-r--r--sys/netinet6/in6.c6
-rw-r--r--sys/netinet6/ip6_mroute.c10
-rw-r--r--sys/netinet6/nd6.c12
3 files changed, 14 insertions, 14 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 2bd9a74b8ae..ca8c78c7b9f 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.235 2020/03/15 05:34:14 visa Exp $ */
+/* $OpenBSD: in6.c,v 1.236 2020/05/27 11:19:29 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -412,7 +412,7 @@ in6_ioctl_get(u_long cmd, caddr_t data, struct ifnet *ifp)
return (error);
}
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
if (sa6 != NULL) {
error = in6_check_embed_scope(sa6, ifp->if_index);
@@ -506,7 +506,7 @@ in6_ioctl_get(u_long cmd, caddr_t data, struct ifnet *ifp)
}
err:
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
return (error);
}
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 9203f5a8c80..ee14687b2ce 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_mroute.c,v 1.123 2020/03/15 05:34:14 visa Exp $ */
+/* $OpenBSD: ip6_mroute.c,v 1.124 2020/05/27 11:19:29 mpi Exp $ */
/* $NetBSD: ip6_mroute.c,v 1.59 2003/12/10 09:28:38 itojun Exp $ */
/* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */
@@ -250,16 +250,16 @@ mrt6_ioctl(struct socket *so, u_long cmd, caddr_t data)
switch (cmd) {
case SIOCGETSGCNT_IN6:
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
error = get_sg6_cnt((struct sioc_sg_req6 *)data,
inp->inp_rtableid);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
break;
case SIOCGETMIFCNT_IN6:
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
error = get_mif6_cnt((struct sioc_mif_req6 *)data,
inp->inp_rtableid);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
break;
default:
error = ENOTTY;
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 2b90caa37c7..118afe3c916 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.231 2020/04/22 07:51:38 mpi Exp $ */
+/* $OpenBSD: nd6.c,v 1.232 2020/05/27 11:19:29 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -1022,9 +1022,9 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
switch (cmd) {
case SIOCGIFINFO_IN6:
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
ndi->ndi = *ND_IFINFO(ifp);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
return (0);
case SIOCGNBRINFO_IN6:
{
@@ -1032,7 +1032,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
struct in6_addr nb_addr = nbi->addr; /* make local for safety */
time_t expire;
- NET_RLOCK();
+ NET_RLOCK_IN_IOCTL();
/*
* XXX: KAME specific hack for scoped addresses
* XXXX: for other scopes than link-local?
@@ -1049,7 +1049,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
if (rt == NULL ||
(ln = (struct llinfo_nd6 *)rt->rt_llinfo) == NULL) {
rtfree(rt);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
return (EINVAL);
}
expire = ln->ln_rt->rt_expire;
@@ -1064,7 +1064,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
nbi->expire = expire;
rtfree(rt);
- NET_RUNLOCK();
+ NET_RUNLOCK_IN_IOCTL();
return (0);
}
}