From aae2af98ca62b17b2bd63e432d65938d7202b9bd Mon Sep 17 00:00:00 2001 From: Sarita Patra Date: Mon, 10 Oct 2022 18:38:14 -0700 Subject: [PATCH] pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP Problem: ======= frr(config)# do show ipv6 pim interface Interface State Address PIM Nbrs PIM DR FHR IfChannels ens192 up fe80::250:56ff:feb7:3619 0 local 0 1 Configure ens192 interface link-local address as RP. frr(config)# ipv6 pim rp fe80::250:56ff:feb7:3619 No Path to RP address specified: fe80::250:56ff:feb7:3619 frr(config)# do show ipv6 pim rp-info RP address group/prefix-list OIF I am RP Source Group-Type fe80::250:56ff:feb7:3619 ff00::/8 Unknown yes Static ASM Fix: === RP should not be link-local, multicast and unspecified address. Signed-off-by: Sarita Patra --- pimd/pim_cmd_common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 9283016d08..a647f92461 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -566,6 +566,18 @@ int pim_process_rp_cmd(struct vty *vty, const char *rp_str, return CMD_WARNING_CONFIG_FAILED; } + if (pim_addr_is_any(rp_addr) || pim_addr_is_multicast(rp_addr)) { + vty_out(vty, "%% Bad RP address specified: %s\n", rp_str); + return CMD_WARNING_CONFIG_FAILED; + } + +#if PIM_IPV == 6 + if (IN6_IS_ADDR_LINKLOCAL(&rp_addr)) { + vty_out(vty, "%% Bad RP address specified: %s\n", rp_str); + return CMD_WARNING_CONFIG_FAILED; + } +#endif + vrfname = pim_cli_get_vrf_name(vty); if (vrfname == NULL) return CMD_WARNING_CONFIG_FAILED; -- 2.39.5