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 <saritap@vmware.com>
This commit is contained in:
Sarita Patra 2022-10-10 18:38:14 -07:00
parent dce0f7468d
commit aae2af98ca

View File

@ -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;