Fixed: [SNMP: snmpwalk is slow and can timeout #404 ](https://github.com/clicon/clixon/issues/404)

Optimized yang_extension_value
This commit is contained in:
Olof hagsand 2023-02-01 14:57:51 +01:00
parent 91034e5361
commit af1f5a037d
6 changed files with 66 additions and 13 deletions

View file

@ -3734,6 +3734,7 @@ yang_anydata_add(yang_stmt *yp,
* }
* @endcode
* @see ys_populate_unknown Called when parsing YANG
* XXX consider optimizing, the call to yang_find_prefix_by_namespace may be slow
*/
int
yang_extension_value(yang_stmt *ys,
@ -3766,6 +3767,7 @@ yang_extension_value(yang_stmt *ys,
continue;
if ((ymod = ys_module(yext)) == NULL)
continue;
/* XXX this is slow */
if ((ret = yang_find_prefix_by_namespace(ymod, ns, &prefix)) < 0)
goto done;
if (ret == 0) /* not found (this may happen in augment and maybe should be treated otherwise) */