return count;
}
- int pim_rp_check_is_my_ip_address(struct pim_instance *pim,
- struct in_addr group,
- struct in_addr dest_addr)
+ bool pim_rp_check_is_my_ip_address(struct pim_instance *pim,
+ struct in_addr dest_addr)
{
- struct rp_info *rp_info;
- struct prefix g;
-
- memset(&g, 0, sizeof(g));
- g.family = AF_INET;
- g.prefixlen = 32;
- g.u.prefix4 = group;
-
- rp_info = pim_rp_find_match_group(pim, &g);
- /*
- * See if we can short-cut some?
- * This might not make sense if we ever leave a static RP
- * type of configuration.
- * Note - Premature optimization might bite our patooeys' here.
- */
- if (I_am_RP(pim, group)) {
- if (dest_addr.s_addr == rp_info->rp.rpf_addr.u.prefix4.s_addr)
- return 1;
- }
-
if (if_lookup_exact_address(&dest_addr, AF_INET, pim->vrf_id))
- return 1;
+ return true;
- return 0;
+ return false;
}
void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
json = json_object_new_object();
else
vty_out(vty,
- "RP address group/prefix-list OIF I am RP\n");
+ "RP address group/prefix-list OIF I am RP\n");
for (ALL_LIST_ELEMENTS_RO(pim->rp_list, node, rp_info)) {
if (!pim_rpf_addr_is_inaddr_none(&rp_info->rp)) {
48));
if (rp_info->rp.source_nexthop.interface)
- vty_out(vty, "%-10s ",
+ vty_out(vty, "%-16s ",
rp_info->rp.source_nexthop
.interface->name);
else
- vty_out(vty, "%-10s ", "(Unknown)");
+ vty_out(vty, "%-16s ", "(Unknown)");
if (rp_info->i_am_rp)
vty_out(vty, "yes\n");
if (!if_is_operative(ifp))
pim_if_addr_del_all(ifp);
+ if_set_index(ifp, IFINDEX_INTERNAL);
+
return 0;
}
pim_upstream_update_join_desired(pim, up);
}
- static void scan_upstream_rpf_cache(struct pim_instance *pim)
- {
- struct listnode *up_node;
- struct listnode *up_nextnode;
- struct pim_upstream *up;
-
- for (ALL_LIST_ELEMENTS(pim->upstream_list, up_node, up_nextnode, up)) {
- enum pim_rpf_result rpf_result;
- struct pim_rpf old;
- struct prefix nht_p;
-
- if (up->upstream_addr.s_addr == INADDR_ANY) {
- if (PIM_DEBUG_TRACE)
- zlog_debug(
- "%s: RP not configured for Upstream %s",
- __PRETTY_FUNCTION__, up->sg_str);
- continue;
- }
-
- nht_p.family = AF_INET;
- nht_p.prefixlen = IPV4_MAX_BITLEN;
- nht_p.u.prefix4.s_addr = up->upstream_addr.s_addr;
- pim_resolve_upstream_nh(pim, &nht_p);
-
- old.source_nexthop.interface = up->rpf.source_nexthop.interface;
- old.source_nexthop.nbr = up->rpf.source_nexthop.nbr;
- rpf_result = pim_rpf_update(pim, up, &old, 0);
-
- if (rpf_result == PIM_RPF_FAILURE)
- continue;
-
- if (rpf_result == PIM_RPF_CHANGED)
- pim_zebra_upstream_rpf_changed(pim, up, &old);
-
- } /* for (qpim_upstream_list) */
-
- pim_zebra_update_all_interfaces(pim);
- }
-
void pim_scan_individual_oil(struct channel_oil *c_oil, int in_vif_index)
{
struct in_addr vif_source;
{
struct pim_instance *pim = THREAD_ARG(t);
- /* update PIM protocol state */
- scan_upstream_rpf_cache(pim);
-
/* update kernel multicast forwarding cache (MFC) */
pim_scan_oil(pim);