summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-04-05 21:51:48 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-04-05 21:51:48 +0000
commit7e4ccd27cfdfbceb30ea07c53ad747f6dc5095fc (patch)
treeb1bb47b2dfac6571e63243b01f5f308a43b693e1 /sys/netinet/ip_input.c
parent97d8da8a6b1f8ca43457237826312668a9f2005f (diff)
ARP has a sysctl to show the number of packets waiting for an arp
response. Implement analog sysctl net.inet6.icmp6.nd6_queued for ND6 to reduce places where mbufs can hide within the kernel. Atomic operations operate on unsigned int. Make the type of total hold queue length consistent. Use atomic load to read the value for the sysctl. This clarifies why no lock around sysctl_rdint() is needed. OK mvs@ kn@
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 07dde2897c5..42c1c72d78d 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.382 2023/03/08 23:17:02 bluhm Exp $ */
+/* $OpenBSD: ip_input.c,v 1.383 2023/04/05 21:51:47 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -1698,7 +1698,8 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_niq(name + 1, namelen - 1,
oldp, oldlenp, newp, newlen, &arpinq));
case IPCTL_ARPQUEUED:
- return (sysctl_rdint(oldp, oldlenp, newp, la_hold_total));
+ return (sysctl_rdint(oldp, oldlenp, newp,
+ atomic_load_int(&la_hold_total)));
case IPCTL_STATS:
return (ip_sysctl_ipstat(oldp, oldlenp, newp));
#ifdef MROUTING