Merge pull request #9682 from adrianomarto/mesh-group-fix

pimd: fixing command "no ip msdp mesh-group member"
This commit is contained in:
Russ White 2021-09-28 10:21:17 -04:00 committed by GitHub
commit 5393318d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -3842,7 +3842,7 @@ static void pim_cli_legacy_mesh_group_behavior(struct vty *vty,
xpath_member_value)) { xpath_member_value)) {
member_dnode = yang_dnode_get(vty->candidate_config->dnode, member_dnode = yang_dnode_get(vty->candidate_config->dnode,
xpath_member_value); xpath_member_value);
if (!yang_is_last_list_dnode(member_dnode)) if (!member_dnode || !yang_is_last_list_dnode(member_dnode))
return; return;
} }
@ -9761,7 +9761,7 @@ DEFPY(no_ip_msdp_mesh_group_member,
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
nb_cli_enqueue_change(vty, xpath_value, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_member_value, NB_OP_DESTROY, NULL);
/* /*
* If this is the last member, then we must remove the group altogether * If this is the last member, then we must remove the group altogether
@ -9795,7 +9795,7 @@ DEFPY(ip_msdp_mesh_group_source,
"frr-pim:pimd", "pim", vrfname, "frr-routing:ipv4", gname); "frr-pim:pimd", "pim", vrfname, "frr-routing:ipv4", gname);
nb_cli_enqueue_change(vty, xpath_value, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_value, NB_OP_CREATE, NULL);
/* Create mesh group member. */ /* Create mesh group source. */
strlcat(xpath_value, "/source", sizeof(xpath_value)); strlcat(xpath_value, "/source", sizeof(xpath_value));
nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, saddr_str); nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, saddr_str);
@ -9826,7 +9826,7 @@ DEFPY(no_ip_msdp_mesh_group_source,
"frr-pim:pimd", "pim", vrfname, "frr-routing:ipv4", gname); "frr-pim:pimd", "pim", vrfname, "frr-routing:ipv4", gname);
nb_cli_enqueue_change(vty, xpath_value, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_value, NB_OP_CREATE, NULL);
/* Create mesh group member. */ /* Create mesh group source. */
strlcat(xpath_value, "/source", sizeof(xpath_value)); strlcat(xpath_value, "/source", sizeof(xpath_value));
nb_cli_enqueue_change(vty, xpath_value, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_value, NB_OP_DESTROY, NULL);

View File

@ -1168,6 +1168,7 @@ int pim_msdp_mesh_group_members_destroy(struct nb_cb_destroy_args *args)
{ {
struct pim_msdp_mg_mbr *mbr; struct pim_msdp_mg_mbr *mbr;
struct pim_msdp_mg *mg; struct pim_msdp_mg *mg;
const struct lyd_node *mg_dnode;
switch (args->event) { switch (args->event) {
case NB_EV_VALIDATE: case NB_EV_VALIDATE:
@ -1176,9 +1177,11 @@ int pim_msdp_mesh_group_members_destroy(struct nb_cb_destroy_args *args)
break; break;
case NB_EV_APPLY: case NB_EV_APPLY:
mbr = nb_running_get_entry(args->dnode, NULL, true); mbr = nb_running_get_entry(args->dnode, NULL, true);
mg = nb_running_get_entry(args->dnode, "../", true); mg_dnode =
yang_dnode_get_parent(args->dnode, "msdp-mesh-groups");
mg = nb_running_get_entry(mg_dnode, NULL, true);
pim_msdp_mg_mbr_del(mg, mbr); pim_msdp_mg_mbr_del(mg, mbr);
nb_running_unset_entry(args->dnode);
break; break;
} }