diff options
author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2017-04-28 17:38:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-28 17:38:05 +0200 |
commit | 71d702a85e1a21d5dcae3109590e597e6e1469f8 (patch) | |
tree | 208ef701949000ae56d9d7153bfd005484606564 /pimd/pim_cmd.c | |
parent | pimd: fix pimd crashes around pim rpf (diff) | |
parent | Merge pull request #381 from donaldsharp/pimmerino (diff) | |
download | frr-71d702a85e1a21d5dcae3109590e597e6e1469f8.tar.xz frr-71d702a85e1a21d5dcae3109590e597e6e1469f8.zip |
Merge branch 'stable/3.0' into pim_dev_3_0
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 390ccbbea..e7910ade3 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3558,6 +3558,33 @@ pim_rp_cmd_worker (struct vty *vty, const char *rp, const char *group, const cha return CMD_SUCCESS; } +static int +pim_cmd_spt_switchover (enum pim_spt_switchover spt, const char *plist) +{ + pimg->spt.switchover = spt; + + switch (pimg->spt.switchover) + { + case PIM_SPT_IMMEDIATE: + if (pimg->spt.plist) + XFREE (MTYPE_PIM_SPT_PLIST_NAME, pimg->spt.plist); + + pim_upstream_add_lhr_star_pimreg (); + break; + case PIM_SPT_INFINITY: + pim_upstream_remove_lhr_star_pimreg (plist); + + if (pimg->spt.plist) + XFREE (MTYPE_PIM_SPT_PLIST_NAME, pimg->spt.plist); + + if (plist) + pimg->spt.plist = XSTRDUP (MTYPE_PIM_SPT_PLIST_NAME, plist); + break; + } + + return CMD_SUCCESS; +} + DEFUN (ip_pim_spt_switchover_infinity, ip_pim_spt_switchover_infinity_cmd, "ip pim spt-switchover infinity-and-beyond", @@ -3566,10 +3593,20 @@ DEFUN (ip_pim_spt_switchover_infinity, "SPT-Switchover\n" "Never switch to SPT Tree\n") { - pimg->spt_switchover = PIM_SPT_INFINITY; + return pim_cmd_spt_switchover (PIM_SPT_INFINITY, NULL); +} - pim_upstream_remove_lhr_star_pimreg(); - return CMD_SUCCESS; +DEFUN (ip_pim_spt_switchover_infinity_plist, + ip_pim_spt_switchover_infinity_plist_cmd, + "ip pim spt-switchover infinity-and-beyond prefix-list WORD", + IP_STR + PIM_STR + "SPT-Switchover\n" + "Never switch to SPT Tree\n" + "Prefix-List to control which groups to switch\n" + "Prefix-List name\n") +{ + return pim_cmd_spt_switchover (PIM_SPT_INFINITY, argv[5]->arg); } DEFUN (no_ip_pim_spt_switchover_infinity, @@ -3581,10 +3618,21 @@ DEFUN (no_ip_pim_spt_switchover_infinity, "SPT_Switchover\n" "Never switch to SPT Tree\n") { - pimg->spt_switchover = PIM_SPT_IMMEDIATE; + return pim_cmd_spt_switchover (PIM_SPT_IMMEDIATE, NULL); +} - pim_upstream_add_lhr_star_pimreg(); - return CMD_SUCCESS; +DEFUN (no_ip_pim_spt_switchover_infinity_plist, + no_ip_pim_spt_switchover_infinity_plist_cmd, + "no ip pim spt-switchover infinity-and-beyond prefix-list WORD", + NO_STR + IP_STR + PIM_STR + "SPT_Switchover\n" + "Never switch to SPT Tree\n" + "Prefix-List to control which groups to switch\n" + "Prefix-List name\n") +{ + return pim_cmd_spt_switchover (PIM_SPT_IMMEDIATE, NULL); } DEFUN (ip_pim_joinprune_time, @@ -6440,7 +6488,9 @@ void pim_cmd_init() install_element (CONFIG_NODE, &ip_pim_register_suppress_cmd); install_element (CONFIG_NODE, &no_ip_pim_register_suppress_cmd); install_element (CONFIG_NODE, &ip_pim_spt_switchover_infinity_cmd); + install_element (CONFIG_NODE, &ip_pim_spt_switchover_infinity_plist_cmd); install_element (CONFIG_NODE, &no_ip_pim_spt_switchover_infinity_cmd); + install_element (CONFIG_NODE, &no_ip_pim_spt_switchover_infinity_plist_cmd); install_element (CONFIG_NODE, &ip_pim_joinprune_time_cmd); install_element (CONFIG_NODE, &no_ip_pim_joinprune_time_cmd); install_element (CONFIG_NODE, &ip_pim_keep_alive_cmd); |