From fd2e9d5dfb0f46d01d510f707c875f8c9b5db4da Mon Sep 17 00:00:00 2001 From: martijn Date: Tue, 28 Jun 2022 09:11:33 +0000 Subject: [PATCH] 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@ --- usr.sbin/snmpd/parse.y | 13 ++++++------- 1 file 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 @@ -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; } ; -- 2.20.1