Skip to content

Commit

Permalink
Merge pull request #14831 from opensourcerouting/libyang-multi-err-ifdef
Browse files Browse the repository at this point in the history
lib: use LYD_VALIDATE_MULTI_ERROR only if available
  • Loading branch information
choppsv1 authored Nov 20, 2023
2 parents f9012ed + 75a7b5b commit 9c1b357
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/northbound.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,12 @@ int nb_candidate_update(struct nb_config *candidate)
int nb_candidate_validate_yang(struct nb_config *candidate, bool no_state,
char *errmsg, size_t errmsg_len)
{
uint32_t options = LYD_VALIDATE_MULTI_ERROR;
uint32_t options = 0;

#ifdef LYD_VALIDATE_MULTI_ERROR
/* libyang 2.1.36+ */
options |= LYD_VALIDATE_MULTI_ERROR;
#endif

if (no_state)
SET_FLAG(options, LYD_VALIDATE_NO_STATE);
Expand Down

0 comments on commit 9c1b357

Please sign in to comment.