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,
|
void *arg,
|
||||||
char *str)
|
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){
|
if ((e = (struct event_data *)malloc(sizeof(struct event_data))) == NULL){
|
||||||
clicon_err(OE_EVENTS, errno, "malloc");
|
clicon_err(OE_EVENTS, errno, "malloc");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -277,7 +284,9 @@ clixon_event_reg_timeout(struct timeval t,
|
||||||
e->e_next = e1;
|
e->e_next = e1;
|
||||||
*e_prev = e;
|
*e_prev = e;
|
||||||
clicon_debug(CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str);
|
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()
|
/*! Deregister a timeout callback as previosly registered by clixon_event_reg_timeout()
|
||||||
|
|
|
||||||
|
|
@ -334,8 +334,10 @@ xp_yang_eval(xp_yang_ctx *xy,
|
||||||
break;
|
break;
|
||||||
case XP_ABSPATH:
|
case XP_ABSPATH:
|
||||||
/* Set context node to top node, and nodeset to that node only */
|
/* Set context node to top node, and nodeset to that node only */
|
||||||
if (yang_keyword_get(xy->xy_node) != Y_SPEC)
|
if (yang_keyword_get(xy->xy_node) != Y_SPEC){
|
||||||
xy->xy_node = ys_module(xy->xy_node);
|
if (ys_real_module(xy->xy_node, &xy->xy_node) < 0)
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XP_PRED:
|
case XP_PRED:
|
||||||
if (xp_yang_eval_predicate(xy, xptree, xyr) < 0)
|
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)
|
if ((ymod = yang_parse_file(fp, filename, yspec)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
/* YANG patch hook */
|
/* 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;
|
goto done;
|
||||||
done:
|
done:
|
||||||
if (fp)
|
if (fp)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue