From: mvs Date: Thu, 20 Apr 2023 21:43:17 +0000 (+0000) Subject: Call sysctl_source() with shared netlock. It performs read-only X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d417fc9013985a8c96f06a24fc5443a59c31020b;p=openbsd Call sysctl_source() with shared netlock. It performs read-only access to netlock protected data. ok kn@ bluhm@ --- 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);