diff options
author | 2018-05-09 13:56:46 +0000 | |
---|---|---|
committer | 2018-05-09 13:56:46 +0000 | |
commit | f2fee00529c06a4f71bb22c241da16b6f0178bf8 (patch) | |
tree | acd4563ff4684f0cff2cf0be396b48fc6fac7b5a | |
parent | Cleanup IPsec AH error handling with consistent goto drop. (diff) | |
download | wireguard-openbsd-f2fee00529c06a4f71bb22c241da16b6f0178bf8.tar.xz wireguard-openbsd-f2fee00529c06a4f71bb22c241da16b6f0178bf8.zip |
As required by IF-MIB, cap ifSpeed at UINT32_MAX; the value is a GAUGE32 so
values above this can't be represented and ifHighSpeed must be used instead.
Problem reported by Arnaud BRAND, ok mpi
-rw-r--r-- | usr.sbin/snmpd/mib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c index 47940c9c2b8..1fed561c435 100644 --- a/usr.sbin/snmpd/mib.c +++ b/usr.sbin/snmpd/mib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mib.c,v 1.85 2017/12/18 05:51:53 cheloha Exp $ */ +/* $OpenBSD: mib.c,v 1.86 2018/05/09 13:56:46 sthen Exp $ */ /* * Copyright (c) 2012 Joel Knight <joel@openbsd.org> @@ -1109,7 +1109,11 @@ mib_iftable(struct oid *oid, struct ber_oid *o, struct ber_element **elm) ber = ber_add_integer(ber, kif->if_mtu); break; case 5: - ber = ber_add_integer(ber, kif->if_baudrate); + if (kif->if_baudrate > UINT32_MAX) { + /* speed should be obtained from ifHighSpeed instead */ + ber = ber_add_integer(ber, UINT32_MAX); + } else + ber = ber_add_integer(ber, kif->if_baudrate); ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_GAUGE32); break; case 6: |