summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-08-13 12:46:20 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-08-13 12:46:20 +0000
commitfeb85afc57f5770d145648a381226567d4e7325a (patch)
tree35f74e51d61222f96447b4801d46f95d68b206d5
parentc31e88d34dad3410a03f6f3f0cb8f88bd1c4ba41 (diff)
Report if_iqdrops (input queue drops) as ifInDiscards. This is pretty
much what this counter is for. For sure better than net.inet.ip.ifq.drops which no longer exists. Found by and OK martijn@ and OK sthen@
-rw-r--r--usr.sbin/snmpd/mib.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c
index 6a965a44b18..7033093e670 100644
--- a/usr.sbin/snmpd/mib.c
+++ b/usr.sbin/snmpd/mib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.c,v 1.94 2019/06/28 13:32:51 deraadt Exp $ */
+/* $OpenBSD: mib.c,v 1.95 2019/08/13 12:46:19 claudio Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
@@ -1195,15 +1195,7 @@ mib_iftable(struct oid *oid, struct ber_oid *o, struct ber_element **elm)
ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_COUNTER32);
break;
case 13:
- mib[3] = IPCTL_IFQUEUE;
- mib[4] = IFQCTL_DROPS;
- len = sizeof(ifq);
- if (sysctl(mib, sizeofa(mib), &ifq, &len, 0, 0) == -1) {
- log_info("mib_iftable: %s: invalid ifq: %s",
- kif->if_name, strerror(errno));
- return (-1);
- }
- ber = ber_add_integer(ber, ifq);
+ ber = ber_add_integer(ber, (u_int32_t)kif->if_iqdrops);
ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_COUNTER32);
break;
case 14: