Fixed: [Using YANG union with decimal64 and string leads to regexp match fail #226](https://github.com/clicon/clixon/issues/226)
This commit is contained in:
parent
d3b614e67d
commit
60c9172d21
3 changed files with 24 additions and 14 deletions
|
|
@ -78,6 +78,7 @@ Users may have to change how they access the system
|
|||
|
||||
### Corrected Bugs
|
||||
|
||||
* Fixed: [Using YANG union with decimal64 and string leads to regexp match fail #226](https://github.com/clicon/clixon/issues/226)
|
||||
* Fixed: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224)
|
||||
* Fixed: RESTCONF Native: Failed binding of socket in network namespace caused process zombie
|
||||
* Fixed problems with XPATH composite operations and functions in netconf get/get-config operations.
|
||||
|
|
|
|||
|
|
@ -2885,7 +2885,7 @@ yang_abs_schema_nodeid(yang_stmt *yn,
|
|||
/* If p0 is NULL an entry will be: [i0] which needs to be transformed to [NULL:i0] */
|
||||
cv = NULL;
|
||||
while ((cv = cvec_each(nodeid_cvv, cv)) != NULL){
|
||||
if (cv_type_get(cv) != CGV_STRING)
|
||||
if (cv_type_get(cv) != CGV_STRING)
|
||||
cv_type_set(cv, CGV_STRING);
|
||||
if ((str = cv_string_get(cv)) == NULL || !strlen(str)){
|
||||
if (cv_string_set(cv, cv_name_get(cv)) < 0){
|
||||
|
|
|
|||
|
|
@ -743,10 +743,15 @@ static int ys_cv_validate_union(clicon_handle h,yang_stmt *ys, char **reason,
|
|||
yang_stmt *yrestype, char *type, char *val, yang_stmt **ysubp);
|
||||
|
||||
/*!
|
||||
* @param[out] reason If given and return val is 0, contains a malloced string
|
||||
* @retval -1 Error (fatal), with errno set to indicate error
|
||||
* @retval 0 Validation not OK, malloced reason is returned. Free reason with free()
|
||||
* @retval 1 Validation OK
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] ys Yang statement (union)
|
||||
* @param[out] reason If given, and return value is 0, contains malloced string
|
||||
* param[in] yt One of the types in the union
|
||||
* param[in] type Original type
|
||||
* @param[in] val Value to match
|
||||
* @retval -1 Error (fatal), with errno set to indicate error
|
||||
* @retval 0 Validation not OK, malloced reason is returned. Free reason with free()
|
||||
* @retval 1 Validation OK
|
||||
*/
|
||||
static int
|
||||
ys_cv_validate_union_one(clicon_handle h,
|
||||
|
|
@ -792,6 +797,8 @@ ys_cv_validate_union_one(clicon_handle h,
|
|||
clicon_err(OE_UNIX, errno, "cv_new");
|
||||
goto done;
|
||||
}
|
||||
if (cvtype == CGV_DEC64)
|
||||
cv_dec64_n_set(cvt, fraction);
|
||||
if (val == NULL){ /* Fail validation on NULL */
|
||||
retval = 0;
|
||||
goto done;
|
||||
|
|
@ -828,21 +835,23 @@ ys_cv_validate_union_one(clicon_handle h,
|
|||
}
|
||||
|
||||
/*! Validate union
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] ys Yang statement (union)
|
||||
* @param[out] reason If given, and return value is 0, contains malloced string
|
||||
* @param[in] val Value to match
|
||||
* @param[out] ysubp Sub-type of ys that matches val
|
||||
* @retval -1 Error (fatal), with errno set to indicate error
|
||||
* @retval 0 Validation not OK, malloced reason is returned. Free reason with free()
|
||||
* @retval 1 Validation OK
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] ys Yang statement (union)
|
||||
* @param[out] reason If given, and return value is 0, contains malloced string
|
||||
* param[in] yrestype Resolved Yang type
|
||||
* param[in] type Original type
|
||||
* @param[in] val Value to match
|
||||
* @param[out] ysubp Sub-type of ys that matches val
|
||||
* @retval -1 Error (fatal), with errno set to indicate error
|
||||
* @retval 0 Validation not OK, malloced reason is returned. Free reason with free()
|
||||
* @retval 1 Validation OK
|
||||
*/
|
||||
static int
|
||||
ys_cv_validate_union(clicon_handle h,
|
||||
yang_stmt *ys,
|
||||
char **reason,
|
||||
yang_stmt *yrestype,
|
||||
char *type, /* orig type */
|
||||
char *type,
|
||||
char *val,
|
||||
yang_stmt **ysubp)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue