]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP 12168/head
authorSarita Patra <saritap@vmware.com>
Tue, 11 Oct 2022 01:38:14 +0000 (18:38 -0700)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 21 Oct 2022 07:35:14 +0000 (07:35 +0000)
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>
(cherry picked from commit aae2af98ca62b17b2bd63e432d65938d7202b9bd)

pimd/pim_cmd_common.c

index 9283016d0814744d39dae496c6987fced134c129..a647f924615a797daa41f27fa6475ad5b6a5fe1c 100644 (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;