forked from Mirror/frr
pimd: fix autorp CLI bugs
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
This commit is contained in:
parent
51b19f9ce3
commit
ba4555c646
|
@ -851,6 +851,7 @@ void pim_autorp_add_candidate_rp_plist(struct pim_instance *pim,
|
||||||
snprintf(rp->grplist, sizeof(rp->grplist), "%s", plist);
|
snprintf(rp->grplist, sizeof(rp->grplist), "%s", plist);
|
||||||
/* A new group prefix list implies that any previous group prefix is now invalid */
|
/* A new group prefix list implies that any previous group prefix is now invalid */
|
||||||
memset(&(rp->grp), 0, sizeof(rp->grp));
|
memset(&(rp->grp), 0, sizeof(rp->grp));
|
||||||
|
rp->grp.family = AF_INET;
|
||||||
|
|
||||||
pim_autorp_new_announcement(pim);
|
pim_autorp_new_announcement(pim);
|
||||||
}
|
}
|
||||||
|
@ -1155,7 +1156,7 @@ void pim_autorp_show_autorp(struct vty *vty, struct pim_instance *pim,
|
||||||
|
|
||||||
table = ttable_dump(tt, "\n");
|
table = ttable_dump(tt, "\n");
|
||||||
vty_out(vty, "%s\n", table);
|
vty_out(vty, "%s\n", table);
|
||||||
XFREE(MTYPE_TMP, table);
|
XFREE(MTYPE_TMP_TTABLE, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
ttable_del(tt);
|
ttable_del(tt);
|
||||||
|
|
|
@ -4609,7 +4609,7 @@ DEFPY (pim_autorp_announce_rp,
|
||||||
"Prefix list\n"
|
"Prefix list\n"
|
||||||
"List name\n")
|
"List name\n")
|
||||||
{
|
{
|
||||||
return pim_process_autorp_candidate_rp_cmd(vty, no, rpaddr_str, grp,
|
return pim_process_autorp_candidate_rp_cmd(vty, no, rpaddr_str, (grp_str ? grp : NULL),
|
||||||
plist);
|
plist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -639,9 +639,9 @@ int pim_process_autorp_candidate_rp_cmd(struct vty *vty, bool no,
|
||||||
char grpstr[64];
|
char grpstr[64];
|
||||||
|
|
||||||
if (no) {
|
if (no) {
|
||||||
if (!is_default_prefix((const struct prefix *)grp) || plist) {
|
if ((grp && !is_default_prefix((const struct prefix *)grp)) || plist) {
|
||||||
/* If any single values are set, only destroy those */
|
/* If any single values are set, only destroy those */
|
||||||
if (!is_default_prefix((const struct prefix *)grp)) {
|
if (grp && !is_default_prefix((const struct prefix *)grp)) {
|
||||||
snprintfrr(xpath, sizeof(xpath),
|
snprintfrr(xpath, sizeof(xpath),
|
||||||
"%s/candidate-rp-list[rp-address='%s']/group",
|
"%s/candidate-rp-list[rp-address='%s']/group",
|
||||||
FRR_PIM_AUTORP_XPATH, rpaddr_str);
|
FRR_PIM_AUTORP_XPATH, rpaddr_str);
|
||||||
|
@ -663,12 +663,12 @@ int pim_process_autorp_candidate_rp_cmd(struct vty *vty, bool no,
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!is_default_prefix((const struct prefix *)grp) || plist) {
|
if ((grp && !is_default_prefix((const struct prefix *)grp)) || plist) {
|
||||||
snprintfrr(xpath, sizeof(xpath),
|
snprintfrr(xpath, sizeof(xpath),
|
||||||
"%s/candidate-rp-list[rp-address='%s']",
|
"%s/candidate-rp-list[rp-address='%s']",
|
||||||
FRR_PIM_AUTORP_XPATH, rpaddr_str);
|
FRR_PIM_AUTORP_XPATH, rpaddr_str);
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
|
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
|
||||||
if (!is_default_prefix((const struct prefix *)grp)) {
|
if (grp && !is_default_prefix((const struct prefix *)grp)) {
|
||||||
snprintfrr(xpath, sizeof(xpath),
|
snprintfrr(xpath, sizeof(xpath),
|
||||||
"%s/candidate-rp-list[rp-address='%s']/group",
|
"%s/candidate-rp-list[rp-address='%s']/group",
|
||||||
FRR_PIM_AUTORP_XPATH, rpaddr_str);
|
FRR_PIM_AUTORP_XPATH, rpaddr_str);
|
||||||
|
|
Loading…
Reference in a new issue