Skip to content

Commit 80e8ccf

Browse files
committed
confd: fix inference from CLI, follow-up to ed23558
The callback refactoring forgot to call ietf_interfaces_cand_init(), breaking inference of interface types and DHCP client options. Also fixes UPDATE event handling for ietf-keystore and infix-meta. Fixes #1244 Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 15a6f69 commit 80e8ccf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/confd/src/core.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int change_cb(sr_session_ctx_t *session, uint32_t sub_id, const char *mod
158158
last_request = request_id;
159159
last_event = event;
160160

161-
if (event == SR_EV_CHANGE || event == SR_EV_DONE) {
161+
if (event == SR_EV_UPDATE || event == SR_EV_CHANGE || event == SR_EV_DONE) {
162162
rc = srx_get_diff(session, &diff);
163163
if (rc != SR_ERR_OK) {
164164
ERROR("Failed to get diff: %d", rc);
@@ -236,6 +236,10 @@ static int change_cb(sr_session_ctx_t *session, uint32_t sub_id, const char *mod
236236
if ((rc = infix_firewall_change(session, config, diff, event, confd)))
237237
goto free_diff;
238238

239+
/* infix-meta */
240+
if ((rc = infix_meta_change_cb(session, config, diff, event, confd)))
241+
goto free_diff;
242+
239243
if (cfg)
240244
sr_release_data(cfg);
241245

@@ -411,6 +415,10 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
411415
goto err;
412416

413417
/* Candidate infer configurations */
418+
rc = ietf_interfaces_cand_init(&confd);
419+
if (rc)
420+
goto err;
421+
414422
rc = ietf_hardware_candidate_init(&confd);
415423
if (rc)
416424
goto err;

src/confd/src/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ int infix_factory_rpc_init(struct confd *confd);
226226
int ietf_factory_default_rpc_init(struct confd *confd);
227227

228228
/* infix-meta.c */
229-
int infix_meta_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
229+
int infix_meta_change_cb(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
230230

231231
/* infix-system-software.c */
232232
int infix_system_sw_rpc_init(struct confd *confd);

0 commit comments

Comments
 (0)