]> git.proxmox.com Git - mirror_frr.git/commitdiff
pim6d: Custom error-message for non-multicast groups
authorSai Gomathi N <nsaigomathi@vmware.com>
Thu, 2 Mar 2023 13:55:17 +0000 (05:55 -0800)
committerSai Gomathi N <nsaigomathi@vmware.com>
Fri, 17 Mar 2023 05:13:26 +0000 (22:13 -0700)
While configuring global or non-multicast address for IPv6 mld join command,
displaying a custom error-message "invalid multicast address"

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
pimd/pim6_cmd.c

index eb29a57e2008fbef063249a815427c20d0faa7a5..9394e4c15a39ae187a58c38f08b9a307e74ad44f 100644 (file)
@@ -539,6 +539,14 @@ DEFPY (interface_ipv6_mld_join,
        "Source address\n")
 {
        char xpath[XPATH_MAXLEN];
+       struct ipaddr group_addr = {0};
+
+       (void)str2ipaddr(group_str, &group_addr);
+
+       if (!IN6_IS_ADDR_MULTICAST(&group_addr)) {
+               vty_out(vty, "Invalid Multicast Address\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
        if (source_str) {
                if (IPV6_ADDR_SAME(&source, &in6addr_any)) {