diff --git a/apps/snmp/snmp_handler.c b/apps/snmp/snmp_handler.c index 952f38a7..a9cc5f9a 100644 --- a/apps/snmp/snmp_handler.c +++ b/apps/snmp/snmp_handler.c @@ -489,11 +489,14 @@ snmp_table_get(clicon_handle h, while ((ys = yn_each(yt, ys)) != NULL) { if (yang_keyword_get(ys) != Y_LEAF) continue; + /* reset oid */ + oidleaflen = MAX_OID_LEN; if ((ret = yangext_oid_get(ys, oidleaf, &oidleaflen, NULL)) < 0) goto done; if (ret == 0) goto done; - assert(oidtlen + 1 == oidleaflen); + if (oidtlen + 1 != oidleaflen) /* Indexes may be from other OID scope, skip those */ + continue; if (oids[oidleaflen-1] == oidleaf[oidleaflen-1]) break; } diff --git a/apps/snmp/snmp_main.c b/apps/snmp/snmp_main.c index 0a0fbc6c..654dee22 100644 --- a/apps/snmp/snmp_main.c +++ b/apps/snmp/snmp_main.c @@ -35,9 +35,11 @@ * It assumes a netsnmp damon is running. * - If netsnmp does not run, clixon_snmp will not start * - If netsnmp dies, clixon_snmp will exit - * - If netsnmp is restarted, so should clixon_snmp be + * - If netsnmp is restarted, clixon_snmp should also be restarted * It is possible to be more resilient, such as setting a timer and trying again, in fact, libnetsnmp - * has some such mechanisms + * has some such mechanisms but these are NOT implemented + * @see RFC 6643 Translation of Structure of Management Information Version 2 (SMIv2) + * MIB Modules to YANG Modules */ #ifdef HAVE_CONFIG_H diff --git a/apps/snmp/snmp_register.c b/apps/snmp/snmp_register.c index d9338a30..f3589a00 100644 --- a/apps/snmp/snmp_register.c +++ b/apps/snmp/snmp_register.c @@ -312,7 +312,7 @@ mibyang_table_register(clicon_handle h, goto done; } } - table_info->min_column = cvec_len(cvk); + table_info->min_column = 1; /* Count columns */ yleaf = NULL;