sync code with last improvements from OpenBSD
This commit is contained in:
parent
2990d002be
commit
f0c5a45f3a
27 changed files with 84 additions and 66 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if.c,v 1.707 2023/08/18 08:10:16 jsg Exp $ */
|
||||
/* $OpenBSD: if.c,v 1.708 2023/09/16 09:33:27 mpi Exp $ */
|
||||
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -2797,7 +2797,8 @@ if_getdata(struct ifnet *ifp, struct if_data *data)
|
|||
if (ifp->if_counters != NULL) {
|
||||
uint64_t counters[ifc_ncounters];
|
||||
|
||||
counters_read(ifp->if_counters, counters, nitems(counters));
|
||||
counters_read(ifp->if_counters, counters, nitems(counters),
|
||||
NULL);
|
||||
|
||||
data->ifi_ipackets += counters[ifc_ipackets];
|
||||
data->ifi_ierrors += counters[ifc_ierrors];
|
||||
|
|
|
@ -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(ðeripstat, 0, sizeof etheripstat);
|
||||
counters_read(etheripcounters, (uint64_t *)ðeripstat,
|
||||
etherips_ncounters);
|
||||
etherips_ncounters, NULL);
|
||||
return (sysctl_rdstruct(oldp, oldlenp, newp, ðeripstat,
|
||||
sizeof(etheripstat)));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_pfsync.c,v 1.320 2023/08/18 08:03:57 jsg Exp $ */
|
||||
/* $OpenBSD: if_pfsync.c,v 1.321 2023/09/16 09:33:27 mpi Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Michael Shalayeff
|
||||
|
@ -3339,7 +3339,7 @@ pfsync_sysctl_pfsyncstat(void *oldp, size_t *oldlenp, void *newp)
|
|||
CTASSERT(sizeof(pfsyncstat) == (pfsyncs_ncounters * sizeof(uint64_t)));
|
||||
memset(&pfsyncstat, 0, sizeof pfsyncstat);
|
||||
counters_read(pfsynccounters, (uint64_t *)&pfsyncstat,
|
||||
pfsyncs_ncounters);
|
||||
pfsyncs_ncounters, NULL);
|
||||
return (sysctl_rdstruct(oldp, oldlenp, newp,
|
||||
&pfsyncstat, sizeof(pfsyncstat)));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: pfkeyv2_convert.c,v 1.80 2023/08/07 03:35:06 dlg Exp $ */
|
||||
/* $OpenBSD: pfkeyv2_convert.c,v 1.81 2023/09/16 09:33:27 mpi Exp $ */
|
||||
/*
|
||||
* The author of this code is Angelos D. Keromytis (angelos@keromytis.org)
|
||||
*
|
||||
|
@ -992,7 +992,7 @@ export_counter(void **p, struct tdb *tdb)
|
|||
uint64_t counters[tdb_ncounters];
|
||||
struct sadb_x_counter *scnt = (struct sadb_x_counter *)*p;
|
||||
|
||||
counters_read(tdb->tdb_counters, counters, tdb_ncounters);
|
||||
counters_read(tdb->tdb_counters, counters, tdb_ncounters, NULL);
|
||||
|
||||
scnt->sadb_x_counter_len = sizeof(struct sadb_x_counter) /
|
||||
sizeof(uint64_t);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: pipex.c,v 1.148 2022/08/30 19:42:29 bluhm Exp $ */
|
||||
/* $OpenBSD: pipex.c,v 1.149 2023/09/16 09:33:27 mpi Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2009 Internet Initiative Japan Inc.
|
||||
|
@ -558,7 +558,7 @@ pipex_export_session_stats(struct pipex_session *session,
|
|||
|
||||
memset(stats, 0, sizeof(*stats));
|
||||
|
||||
counters_read(session->stat_counters, counters, pxc_ncounters);
|
||||
counters_read(session->stat_counters, counters, pxc_ncounters, NULL);
|
||||
stats->ipackets = counters[pxc_ipackets];
|
||||
stats->ierrors = counters[pxc_ierrors];
|
||||
stats->ibytes = counters[pxc_ibytes];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: rtsock.c,v 1.369 2023/07/28 09:33:16 mvs Exp $ */
|
||||
/* $OpenBSD: rtsock.c,v 1.370 2023/09/16 09:33:27 mpi Exp $ */
|
||||
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -2245,7 +2245,7 @@ sysctl_rtable_rtstat(void *oldp, size_t *oldlenp, void *newp)
|
|||
|
||||
CTASSERT(sizeof(rtstat) == (nitems(counters) * sizeof(uint32_t)));
|
||||
memset(&rtstat, 0, sizeof rtstat);
|
||||
counters_read(rtcounters, counters, nitems(counters));
|
||||
counters_read(rtcounters, counters, nitems(counters), NULL);
|
||||
|
||||
for (i = 0; i < nitems(counters); i++)
|
||||
words[i] = (uint32_t)counters[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue