summaryrefslogtreecommitdiff
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2022-06-28 10:01:14 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2022-06-28 10:01:14 +0000
commit59b53b08aef84c836289f4230075c47316c9fb05 (patch)
tree07961b67968ea166321c6b3e7e87e51761b3a5a7 /sys/net/rtsock.c
parent19ce84fd9068377523942d050c4431789e9dc468 (diff)
Use refcnt API for struct rtentry instead of hand-crafted atomic
operations. OK mvs@
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 7b4e544fced..fde6ec78565 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.333 2022/06/27 21:26:46 claudio Exp $ */
+/* $OpenBSD: rtsock.c,v 1.334 2022/06/28 10:01:13 bluhm Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -2003,7 +2003,7 @@ sysctl_dumpentry(struct rtentry *rt, void *v, unsigned int id)
rtm->rtm_priority = rt->rt_priority & RTP_MASK;
rtm_getmetrics(rt, &rtm->rtm_rmx);
/* Do not account the routing table's reference. */
- rtm->rtm_rmx.rmx_refcnt = rt->rt_refcnt - 1;
+ rtm->rtm_rmx.rmx_refcnt = refcnt_read(&rt->rt_refcnt) - 1;
rtm->rtm_index = rt->rt_ifidx;
rtm->rtm_addrs = info.rti_addrs;
rtm->rtm_tableid = id;