]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_cmd.c
lib: Add LIB_ERR_SNMP
[mirror_frr.git] / pimd / pim_cmd.c
index 123c47568cb0a5b6ec61b4c6cb7a05a877901f37..6eb4303fb712aaeb5c1f3e6d75058a90c0d541c7 100644 (file)
@@ -2038,7 +2038,7 @@ static void pim_show_state(struct pim_instance *pim, struct vty *vty,
                } else {
                        vty_out(vty, "%-9d %-15s  %-15s  %-7s  ",
                                c_oil->installed, src_str, grp_str,
-                               ifp_in->name);
+                               in_ifname);
                }
 
                for (oif_vif_index = 0; oif_vif_index < MAXVIFS;
@@ -4252,7 +4252,7 @@ DEFUN (show_ip_pim_nexthop_lookup,
        "Source/RP address\n"
        "Multicast Group address\n")
 {
-       struct pim_nexthop_cache pnc;
+       struct pim_nexthop_cache *pnc = NULL;
        struct prefix nht_p;
        int result = 0;
        struct in_addr src_addr, grp_addr;
@@ -4264,6 +4264,7 @@ DEFUN (show_ip_pim_nexthop_lookup,
        char grp_str[PREFIX_STRLEN];
        int idx = 2;
        struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
+       struct pim_rpf rpf;
 
        if (!vrf)
                return CMD_WARNING;
@@ -4301,7 +4302,6 @@ DEFUN (show_ip_pim_nexthop_lookup,
                                      grp_addr))
                return CMD_SUCCESS;
 
-       memset(&pnc, 0, sizeof(struct pim_nexthop_cache));
        nht_p.family = AF_INET;
        nht_p.prefixlen = IPV4_MAX_BITLEN;
        nht_p.u.prefix4 = vif_source;
@@ -4310,12 +4310,18 @@ DEFUN (show_ip_pim_nexthop_lookup,
        grp.u.prefix4 = grp_addr;
        memset(&nexthop, 0, sizeof(nexthop));
 
-       if (pim_find_or_track_nexthop(vrf->info, &nht_p, NULL, NULL, &pnc))
-               result = pim_ecmp_nexthop_search(vrf->info, &pnc, &nexthop,
+       memset(&rpf, 0, sizeof(struct pim_rpf));
+       rpf.rpf_addr.family = AF_INET;
+       rpf.rpf_addr.prefixlen = IPV4_MAX_BITLEN;
+       rpf.rpf_addr.u.prefix4 = vif_source;
+
+       pnc = pim_nexthop_cache_find(vrf->info, &rpf);
+       if (pnc)
+               result = pim_ecmp_nexthop_search(vrf->info, pnc, &nexthop,
                                                 &nht_p, &grp, 0);
        else
-               result = pim_ecmp_nexthop_lookup(vrf->info, &nexthop,
-                                                vif_source, &nht_p, &grp, 0);
+               result = pim_ecmp_nexthop_lookup(vrf->info, &nexthop, &nht_p,
+                                                &grp, 0);
 
        if (!result) {
                vty_out(vty,
@@ -5100,11 +5106,6 @@ static int pim_rp_cmd_worker(struct pim_instance *pim, struct vty *vty,
 
        result = pim_rp_new(pim, rp, group, plist);
 
-       if (result == PIM_MALLOC_FAIL) {
-               vty_out(vty, "%% Out of memory\n");
-               return CMD_WARNING_CONFIG_FAILED;
-       }
-
        if (result == PIM_GROUP_BAD_ADDRESS) {
                vty_out(vty, "%% Bad group address specified: %s\n", group);
                return CMD_WARNING_CONFIG_FAILED;
@@ -7541,7 +7542,12 @@ DEFUN (no_ip_pim_bfd,
        return CMD_SUCCESS;
 }
 
-DEFUN (ip_pim_bfd_param,
+#if HAVE_BFDD > 0
+DEFUN_HIDDEN(
+#else
+DEFUN(
+#endif /* HAVE_BFDD */
+       ip_pim_bfd_param,
        ip_pim_bfd_param_cmd,
        "ip pim bfd (2-255) (50-60000) (50-60000)",
        IP_STR
@@ -7579,12 +7585,14 @@ DEFUN (ip_pim_bfd_param,
        return CMD_SUCCESS;
 }
 
+#if HAVE_BFDD == 0
 ALIAS(no_ip_pim_bfd, no_ip_pim_bfd_param_cmd,
       "no ip pim bfd (2-255) (50-60000) (50-60000)", NO_STR IP_STR PIM_STR
       "Enables BFD support\n"
       "Detect Multiplier\n"
       "Required min receive interval\n"
       "Desired min transmit interval\n")
+#endif /* !HAVE_BFDD */
 
 static int ip_msdp_peer_cmd_worker(struct pim_instance *pim, struct vty *vty,
                                   const char *peer, const char *local)
@@ -8900,5 +8908,7 @@ void pim_cmd_init(void)
        install_element(INTERFACE_NODE, &ip_pim_bfd_cmd);
        install_element(INTERFACE_NODE, &ip_pim_bfd_param_cmd);
        install_element(INTERFACE_NODE, &no_ip_pim_bfd_cmd);
+#if HAVE_BFDD == 0
        install_element(INTERFACE_NODE, &no_ip_pim_bfd_param_cmd);
+#endif /* !HAVE_BFDD */
 }