summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/parse.y
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2022-06-28 09:11:34 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2022-06-28 09:11:34 +0000
commit00d6d1f04f2fd891fe7189dbd0e986b9e0e02827 (patch)
tree8b1388cf8e7f2c1c85031e71d592a532cbde0dc2 /usr.sbin/snmpd/parse.y
parent4b912e0932ad83384e3e2f29794f16dc6d50d2aa (diff)
Use smi_string2oid instead of ober_string2oid in parse.y's oid definition.
This allows admins to configure oids as pretty symbolic names, next to the current numeric names. OK sthen@
Diffstat (limited to 'usr.sbin/snmpd/parse.y')
-rw-r--r--usr.sbin/snmpd/parse.y13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/snmpd/parse.y b/usr.sbin/snmpd/parse.y
index b1b3d5c9dd7..b390ff65606 100644
--- a/usr.sbin/snmpd/parse.y
+++ b/usr.sbin/snmpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.73 2021/11/21 13:33:53 martijn Exp $ */
+/* $OpenBSD: parse.y,v 1.74 2022/06/28 09:11:33 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -666,21 +666,20 @@ optwrite : READONLY { $$ = 0; }
;
oid : STRING {
- struct ber_oid *sysoid;
- if ((sysoid =
- calloc(1, sizeof(*sysoid))) == NULL) {
+ struct ber_oid *oid;
+ if ((oid = calloc(1, sizeof(*oid))) == NULL) {
yyerror("calloc");
free($1);
YYERROR;
}
- if (ober_string2oid($1, sysoid) == -1) {
+ if (smi_string2oid($1, oid) == -1) {
yyerror("invalid OID: %s", $1);
- free(sysoid);
+ free(oid);
free($1);
YYERROR;
}
free($1);
- $$ = sysoid;
+ $$ = oid;
}
;