yang path sanity checks and use of real module as root
This commit is contained in:
parent
56f15aeefd
commit
fcb6e5cb03
3 changed files with 16 additions and 5 deletions
|
|
@ -255,8 +255,15 @@ clixon_event_reg_timeout(struct timeval t,
|
|||
void *arg,
|
||||
char *str)
|
||||
{
|
||||
struct event_data *e, *e1, **e_prev;
|
||||
int retval = -1;
|
||||
struct event_data *e;
|
||||
struct event_data *e1;
|
||||
struct event_data **e_prev;
|
||||
|
||||
if (str == NULL || fn == NULL){
|
||||
clicon_err(OE_CFG, EINVAL, "str or fn is NULL");
|
||||
goto done;
|
||||
}
|
||||
if ((e = (struct event_data *)malloc(sizeof(struct event_data))) == NULL){
|
||||
clicon_err(OE_EVENTS, errno, "malloc");
|
||||
return -1;
|
||||
|
|
@ -277,7 +284,9 @@ clixon_event_reg_timeout(struct timeval t,
|
|||
e->e_next = e1;
|
||||
*e_prev = e;
|
||||
clicon_debug(CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str);
|
||||
return 0;
|
||||
retval = 0;
|
||||
done:
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*! Deregister a timeout callback as previosly registered by clixon_event_reg_timeout()
|
||||
|
|
|
|||
|
|
@ -334,8 +334,10 @@ xp_yang_eval(xp_yang_ctx *xy,
|
|||
break;
|
||||
case XP_ABSPATH:
|
||||
/* Set context node to top node, and nodeset to that node only */
|
||||
if (yang_keyword_get(xy->xy_node) != Y_SPEC)
|
||||
xy->xy_node = ys_module(xy->xy_node);
|
||||
if (yang_keyword_get(xy->xy_node) != Y_SPEC){
|
||||
if (ys_real_module(xy->xy_node, &xy->xy_node) < 0)
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
case XP_PRED:
|
||||
if (xp_yang_eval_predicate(xy, xptree, xyr) < 0)
|
||||
|
|
|
|||
|
|
@ -1043,7 +1043,7 @@ yang_parse_filename(clicon_handle h,
|
|||
if ((ymod = yang_parse_file(fp, filename, yspec)) < 0)
|
||||
goto done;
|
||||
/* YANG patch hook */
|
||||
if (h && clixon_plugin_yang_patch_all(h, ymod) < 0)
|
||||
if (ymod && h && clixon_plugin_yang_patch_all(h, ymod) < 0)
|
||||
goto done;
|
||||
done:
|
||||
if (fp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue