Skip to content
Snippets Groups Projects
Commit 0dca0685 authored by Surya  Pratap  Singh's avatar Surya Pratap Singh Committed by Markus Gothe
Browse files

R#44710 - SNMP: snmpwalk does not work if sysObjectID is not present

Fixed snmpwalk error if sysObjectID is not present or
system interface in snmpd config not present

Change-Id: I42dad87b6f1fde6efb4a096fbe9960f7b459b65c
parent 7b1169af
No related branches found
No related tags found
No related merge requests found
......@@ -179,11 +179,17 @@ int handle_sysObjectID(netsnmp_mib_handler *handler,
char sys_ObjectID_str[MAX_STR_SIZE];
oid sys_ObjectID_oid[MAX_OID_LEN];
size_t sys_ObjectID_oid_len = MAX_OID_LEN;
int param_status = -1;
switch (reqinfo->mode) {
case MODE_GET:
/* call uci to get sysObjectID value from configuration file */
get_uci_str_params("snmpd", "system", "sysObjectID", sys_ObjectID_str, sizeof(sys_ObjectID_str));
param_status = get_uci_str_params("snmpd", "system", "sysObjectID", sys_ObjectID_str, sizeof(sys_ObjectID_str));
/* Handle the case when sysObjectID is not present or system interface is not present */
if (param_status == -1) {
return SNMP_ERR_NOERROR;
}
/* parse the string representation of the object ID */
if (snmp_parse_oid(sys_ObjectID_str, sys_ObjectID_oid, &sys_ObjectID_oid_len) == NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment