Skip to content

privcand UPDATE add private candidate datastore support#1805

Open
Ardival wants to merge 1 commit intoCESNET:develfrom
Ardival:devel
Open

privcand UPDATE add private candidate datastore support#1805
Ardival wants to merge 1 commit intoCESNET:develfrom
Ardival:devel

Conversation

@Ardival
Copy link
Copy Markdown

@Ardival Ardival commented Apr 30, 2026

  • include corresponding tests

Comment thread modules/ietf-netconf-private-candidate@2026-02-03.yang Outdated
Comment thread src/common.c Outdated
Comment thread src/common.c Outdated
Comment thread src/common.c Outdated
Comment thread src/common.h Outdated
Comment thread src/netconf.c
Comment thread src/common.h
Comment thread tests/test_privcand.c Outdated
Comment thread tests/test_privcand.c Outdated
Comment thread tests/test_privcand.c
Comment thread src/common.c

cleanup:
free(xpath);
if (r) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be uninitialized (if conflist_set is NULL).

Comment thread src/common.c
}

/* add conflict node into error msg*/
nc_err_add_info_other(err, err_info_node);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearer and more readable code would be to move err_info_node = NULL; right after this line and also initializing err_info_node to NULL. Then lyd_free_tree(err_info_node) in the cleanup could be moved outside the r condition.

Comment thread src/common.h
int use_private_cand; /* flag to use private candidate instead of shared candidate */
sr_priv_cand_t *private_ds; /* private candidate structure */
sr_priv_cand_t *private_ds_backup; /* backup of private candidate */
int privcand_lock; /* lock for private candidate */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, mention the purpose at least a but more clearly. Something like flag for tracking the lock state, changed by <lock> and <unlock> RPCs.

Comment thread src/netconf.c
goto cleanup;
}

if (sr_pc_validate(user_sess->sess, NULL, user_sess->private_ds)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be called only for test-only, just like in the standard edit-config.

Comment thread src/common.h
* @param[in] conflict_set Set of conflicts.
* @return Server reply structure.
*/
struct nc_server_reply *np_reply_err_conflict(const struct lyd_node *rpc, sr_pc_conflict_set_t *conflict_set);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conflict_set should now be const.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants