summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2023-11-12 19:58:16 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2023-11-12 19:58:16 +0000
commit1d630db1a3cf3dfb57f9e92ab79cc0322a5f79d4 (patch)
treee4b0e403b8b425c5636dbaaa9d927e0b040b6d3a /usr.sbin
parent99208b02f0d711b985efade07dd18c6b1adfd6ed (diff)
No reason to call (error-prone) smi_scalar_oidlen when we include the
scalar .0 ourselves. OK tb@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/snmpd/trap.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/usr.sbin/snmpd/trap.c b/usr.sbin/snmpd/trap.c
index acdce028ac0..873251f84b9 100644
--- a/usr.sbin/snmpd/trap.c
+++ b/usr.sbin/snmpd/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.37 2021/09/02 05:41:02 martijn Exp $ */
+/* $OpenBSD: trap.c,v 1.38 2023/11/12 19:58:15 martijn Exp $ */
/*
* Copyright (c) 2008 Reyk Floeter <reyk@openbsd.org>
@@ -42,13 +42,11 @@
void
trap_init(void)
{
- struct ber_oid trapoid = OID(MIB_coldStart);
-
/*
* Send a coldStart to notify that the daemon has been
* started and re-initialized.
*/
- trap_send(&trapoid, NULL);
+ trap_send(&OID(MIB_coldStart, 0), NULL);
}
int
@@ -56,8 +54,8 @@ trap_send(struct ber_oid *oid, struct ber_element *elm)
{
struct trap_address *tr;
struct ber_element *vblist, *trap;
- struct ber_oid uptime = OID(MIB_sysUpTime);
- struct ber_oid trapoid = OID(MIB_snmpTrapOID);
+ struct ber_oid uptime = OID(MIB_sysUpTime, 0);
+ struct ber_oid trapoid = OID(MIB_snmpTrapOID, 0);
char ostr[SNMP_MAX_OID_STRLEN];
struct oid oa, ob;
struct snmp_message *msg;
@@ -65,10 +63,6 @@ trap_send(struct ber_oid *oid, struct ber_element *elm)
if (TAILQ_EMPTY(&snmpd_env->sc_trapreceivers))
return (0);
- smi_scalar_oidlen(&uptime);
- smi_scalar_oidlen(&trapoid);
- smi_scalar_oidlen(oid);
-
smi_oid2string(oid, ostr, sizeof(ostr), 0);
log_debug("trap_send: oid %s", ostr);