mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-01 13:23:01 +02:00
confd: fix inference from CLI, follow-up to ed235583
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 <troglobit@gmail.com>
This commit is contained in:
@@ -158,7 +158,7 @@ static int change_cb(sr_session_ctx_t *session, uint32_t sub_id, const char *mod
|
||||
last_request = request_id;
|
||||
last_event = event;
|
||||
|
||||
if (event == SR_EV_CHANGE || event == SR_EV_DONE) {
|
||||
if (event == SR_EV_UPDATE || event == SR_EV_CHANGE || event == SR_EV_DONE) {
|
||||
rc = srx_get_diff(session, &diff);
|
||||
if (rc != SR_ERR_OK) {
|
||||
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
|
||||
if ((rc = infix_firewall_change(session, config, diff, event, confd)))
|
||||
goto free_diff;
|
||||
|
||||
/* infix-meta */
|
||||
if ((rc = infix_meta_change_cb(session, config, diff, event, confd)))
|
||||
goto free_diff;
|
||||
|
||||
if (cfg)
|
||||
sr_release_data(cfg);
|
||||
|
||||
@@ -411,6 +415,10 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
|
||||
goto err;
|
||||
|
||||
/* Candidate infer configurations */
|
||||
rc = ietf_interfaces_cand_init(&confd);
|
||||
if (rc)
|
||||
goto err;
|
||||
|
||||
rc = ietf_hardware_candidate_init(&confd);
|
||||
if (rc)
|
||||
goto err;
|
||||
|
||||
@@ -226,7 +226,7 @@ int infix_factory_rpc_init(struct confd *confd);
|
||||
int ietf_factory_default_rpc_init(struct confd *confd);
|
||||
|
||||
/* infix-meta.c */
|
||||
int infix_meta_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
|
||||
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);
|
||||
|
||||
/* infix-system-software.c */
|
||||
int infix_system_sw_rpc_init(struct confd *confd);
|
||||
|
||||
Reference in New Issue
Block a user