From: Donald Sharp Date: Thu, 30 Mar 2017 03:23:25 +0000 (-0400) Subject: pimd: Add code to allow backwards compatibility X-Git-Tag: reindent-master-before~222^2~10 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=71bbe73dc4fb308b1abca5a326c6c59e1193d794;p=mirror%2Ffrr.git pimd: Add code to allow backwards compatibility This code change adds the ability to specify that we should be able to work with older versions of PIM. In future commits we will actually use this data. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index cf101b3e24..66fc8185d0 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3509,6 +3509,31 @@ DEFUN (no_ip_pim_packets, return CMD_SUCCESS; } +DEFUN (ip_pim_v6_secondary, + ip_pim_v6_secondary_cmd, + "ip pim send-v6-secondary", + IP_STR + "pim multicast routing\n" + "Send v6 secondary addresses\n") +{ + pimg->send_v6_secondary = 1; + + return CMD_SUCCESS; +} + +DEFUN (no_ip_pim_v6_secondary, + no_ip_pim_v6_secondary_cmd, + "no ip pim send-v6-secondary", + NO_STR + IP_STR + "pim multicast routing\n" + "Send v6 secondary addresses\n") +{ + pimg->send_v6_secondary = 0; + + return CMD_SUCCESS; +} + DEFUN (ip_pim_rp, ip_pim_rp_cmd, "ip pim rp A.B.C.D [A.B.C.D/M]", @@ -6037,6 +6062,8 @@ void pim_cmd_init() install_element (CONFIG_NODE, &no_ip_pim_keep_alive_cmd); install_element (CONFIG_NODE, &ip_pim_packets_cmd); install_element (CONFIG_NODE, &no_ip_pim_packets_cmd); + install_element (CONFIG_NODE, &ip_pim_v6_secondary_cmd); + install_element (CONFIG_NODE, &no_ip_pim_v6_secondary_cmd); install_element (CONFIG_NODE, &ip_ssmpingd_cmd); install_element (CONFIG_NODE, &no_ip_ssmpingd_cmd); install_element (CONFIG_NODE, &ip_msdp_peer_cmd); diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 5b6a79b95a..9788c58cd9 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -148,6 +148,12 @@ int pim_global_config_write(struct vty *vty) writes += pim_msdp_config_write (vty); + if (!pimg->send_v6_secondary) + { + vty_out (vty, "no ip pim send-v6-secondary%s", VTY_NEWLINE); + ++writes; + } + writes += pim_rp_config_write (vty); if (qpim_register_suppress_time != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) diff --git a/pimd/pimd.c b/pimd/pimd.c index b67544b28e..9058e14b0a 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -109,6 +109,8 @@ pim_vrf_enable (struct vrf *vrf) if (pimg == NULL) zlog_err ("%s %s: pim class init failure ", __FILE__, __PRETTY_FUNCTION__); + + pimg->send_v6_secondary = 1; } return 0; } diff --git a/pimd/pimd.h b/pimd/pimd.h index b3bdd9e243..8dc5899022 100644 --- a/pimd/pimd.h +++ b/pimd/pimd.h @@ -240,6 +240,8 @@ struct pim_instance afi_t afi; vrf_id_t vrf_id; struct hash *rpf_hash; + + int send_v6_secondary; }; extern struct pim_instance *pimg; //Pim Global Instance