summaryrefslogtreecommitdiff
path: root/sys/net/if_etherip.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2023-09-16 09:33:29 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2023-09-16 09:33:29 +0000
commitfff317a1d2654248f137b1b92993cc737921b110 (patch)
tree4d1cb84a19d51934c530fd92b6321ff3519eb995 /sys/net/if_etherip.c
parent817d1e1b3d749f30a8a76eba5823137fb9695bde (diff)
Allow counters_read(9) to take an optional scratch buffer.
Using a scratch buffer makes it possible to take a consistent snapshot of per-CPU counters without having to allocate memory. Makes ddb(4) show uvmexp command work in OOM situations. ok kn@, mvs@, cheloha@
Diffstat (limited to 'sys/net/if_etherip.c')
-rw-r--r--sys/net/if_etherip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c
index 3abc9d4b5aa..4abd3f167e4 100644
--- a/sys/net/if_etherip.c
+++ b/sys/net/if_etherip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_etherip.c,v 1.50 2022/02/28 00:12:11 dlg Exp $ */
+/* $OpenBSD: if_etherip.c,v 1.51 2023/09/16 09:33:27 mpi Exp $ */
/*
* Copyright (c) 2015 Kazuya GODA <goda@openbsd.org>
*
@@ -789,7 +789,7 @@ etherip_sysctl_etheripstat(void *oldp, size_t *oldlenp, void *newp)
sizeof(uint64_t)));
memset(&etheripstat, 0, sizeof etheripstat);
counters_read(etheripcounters, (uint64_t *)&etheripstat,
- etherips_ncounters);
+ etherips_ncounters, NULL);
return (sysctl_rdstruct(oldp, oldlenp, newp, &etheripstat,
sizeof(etheripstat)));
}