diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2014-11-19 10:19:01 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2014-11-19 10:19:01 +0000 |
commit | ff01fb2a97a4878f33c682a1e5148449d815102c (patch) | |
tree | e7802db249a7db6747d2f14843eb12da49e9b3d5 /usr.sbin/snmpd/parse.y | |
parent | 5df5cffb8baae7d93397602aec987c965354dd8f (diff) |
add support for AgentX subagents in snmpd
snmp requests are now packaged into pseudo-continuations
to allow for being dispatched to seperate processes;
lightly tested for interoperability with NetSNMP, but
doesn't implement the complete set of AgentX messages
while here, clean up return types of mps_get* functions,
and make smi_insert refuse to insert duplicate OIDs
okay benno@ reyk@
Diffstat (limited to 'usr.sbin/snmpd/parse.y')
-rw-r--r-- | usr.sbin/snmpd/parse.y | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/parse.y b/usr.sbin/snmpd/parse.y index 79be9355283..64fedafec7f 100644 --- a/usr.sbin/snmpd/parse.y +++ b/usr.sbin/snmpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.34 2014/11/16 19:07:51 bluhm Exp $ */ +/* $OpenBSD: parse.y,v 1.35 2014/11/19 10:19:00 blambert Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org> @@ -372,7 +372,12 @@ mib : OBJECTID oid NAME STRING optwrite objtype { if ($5) oid->o_flags |= OID_WR; - smi_insert(oid); + if (smi_insert(oid) == -1) { + yyerror("duplicate oid"); + free(oid->o_name); + free(oid->o_data); + YYERROR; + } } ; |