From 19e27806566f2d99a1274a6f5c3acb34512a55e8 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Tue, 20 Sep 2016 14:06:20 +0200 Subject: [PATCH] Fix bug #49136: No SNMPv2 SetRequest response when OID does not exist --- src/apps/snmp/snmp_msg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/snmp/snmp_msg.c b/src/apps/snmp/snmp_msg.c index be98a4f6..25c3b3ed 100644 --- a/src/apps/snmp/snmp_msg.c +++ b/src/apps/snmp/snmp_msg.c @@ -525,6 +525,9 @@ snmp_process_set_request(struct snmp_request *request) if (node_instance.release_instance != NULL) { node_instance.release_instance(&node_instance); } + } else if ((request->error_status == SNMP_ERR_NOSUCHINSTANCE) || (request->error_status == SNMP_ERR_NOSUCHOBJECT) || (request->error_status == SNMP_ERR_ENDOFMIBVIEW)) { + /* according to RFC 1905 (4.2.5. The SetRequest-PDU) return 'NotWritable' for unknown OIDs */ + request->error_status = SNMP_ERR_NOTWRITABLE; } } else if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { /* no more varbinds in request */