summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-04-20 21:43:18 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-04-20 21:43:18 +0000
commit5810f873c4f50bfb24443650a93bf4540ed76598 (patch)
treeaeec8e0984b645610c05ebd93521b50ec69d7e79 /sys/net
parentb1d70f813d213f694361530076208226fc39cbd7 (diff)
Call sysctl_source() with shared netlock. It performs read-only
access to netlock protected data. ok kn@ bluhm@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/rtsock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 58afbba9182..fbd4177b177 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.364 2023/04/19 17:42:47 bluhm Exp $ */
+/* $OpenBSD: rtsock.c,v 1.365 2023/04/20 21:43:17 mvs Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -2205,7 +2205,7 @@ sysctl_rtable(int *name, u_int namelen, void *where, size_t *given, void *new,
tableid = w.w_arg;
if (!rtable_exists(tableid))
return (ENOENT);
- NET_LOCK();
+ NET_LOCK_SHARED();
for (i = 1; i <= AF_MAX; i++) {
if (af != 0 && af != i)
continue;
@@ -2216,7 +2216,7 @@ sysctl_rtable(int *name, u_int namelen, void *where, size_t *given, void *new,
if (error)
break;
}
- NET_UNLOCK();
+ NET_UNLOCK_SHARED();
break;
}
free(w.w_tmem, M_RTABLE, w.w_tmemsize);