Skip to content

Commit 474aeca

Browse files
jeremie6windRoytak
authored andcommitted
server config BUGFIX don't configure deleted endpoint
An endpoint may fail to be created if is after a deleted endpoint depending on the order in the list of endpoints. This patch don't try to create deleted endpoints. Skip the endpoint with the 'delete' yang operation. This fixes this error message: > Endpoint "<endpoint name>" was not found. > Applying ietf-netconf-server configuration failed.
1 parent dcae84e commit 474aeca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/server_config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,6 +4303,7 @@ nc_server_config_listen_all_endpoints(const struct lyd_node *node)
43034303
struct lyd_node *n, *iter;
43044304
struct nc_endpt *endpt;
43054305
struct nc_bind *bind;
4306+
struct lyd_meta *m;
43064307

43074308
NC_CHECK_ERR_RET(strcmp(LYD_NAME(node), "netconf-server"),
43084309
ERR(NULL, "Unexpected node \"%s\" encountered, expected \"netconf-server\".", LYD_NAME(node)), 1);
@@ -4314,6 +4315,11 @@ nc_server_config_listen_all_endpoints(const struct lyd_node *node)
43144315
if (n) {
43154316
/* go over all the endpoints */
43164317
LY_LIST_FOR(lyd_child(n), iter) {
4318+
if ((m = lyd_find_meta(iter->meta, NULL, "yang:operation"))) {
4319+
if (!strcmp(lyd_get_meta_value(m), "delete")) {
4320+
continue;
4321+
}
4322+
}
43174323
/* get the endpoint and bind structs from the node */
43184324
NC_CHECK_RET(nc_server_config_get_endpt(iter, &endpt, &bind));
43194325

0 commit comments

Comments
 (0)