summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2021-10-25 11:21:33 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2021-10-25 11:21:33 +0000
commitf7963d8225242586ae7a1a388ba4dba0ddaa4185 (patch)
treee791a8f4c1467a9ce3f80e1275c532e1a22b0d77 /usr.sbin
parent2a5be339062bed347c3b7456974e460fa19f5d3b (diff)
If we use type to SNMP_V2 we should check against that.
Reported by Johan Huldtgren (jhuldtgren <at> gmail <dot> com) via sthen@ OK sthen@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/snmpd/parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/parse.y b/usr.sbin/snmpd/parse.y
index f55d523f2e4..eaa334c2f3c 100644
--- a/usr.sbin/snmpd/parse.y
+++ b/usr.sbin/snmpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.71 2021/10/20 16:00:47 gerhard Exp $ */
+/* $OpenBSD: parse.y,v 1.72 2021/10/25 11:21:32 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -821,7 +821,7 @@ hostdef : STRING hostoid hostauth srcaddr {
}
tr->ta_oid = $2;
tr->ta_version = $3.type;
- if ($3.type == ADDRESS_FLAG_SNMPV2) {
+ if ($3.type == SNMP_V2) {
(void)strlcpy(tr->ta_community, $3.data,
sizeof(tr->ta_community));
free($3.data);