#include "if.h"
#include "vty.h"
#include "plist.h"
+#include "lib_errors.h"
#include "pimd.h"
#include "pim_neighbor.h"
zassert(pim_ifp);
neigh = XCALLOC(MTYPE_PIM_NEIGHBOR, sizeof(*neigh));
- if (!neigh) {
- zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
- sizeof(*neigh));
- return 0;
- }
neigh->creation = pim_time_monotonic_sec();
neigh->source_addr = source_addr;
}
#endif
- list_delete(neigh->prefix_list);
- neigh->prefix_list = 0;
+ list_delete(&neigh->prefix_list);
}
}
delete_prefix_list(neigh);
- list_delete(neigh->upstream_jp_agg);
+ list_delete(&neigh->upstream_jp_agg);
THREAD_OFF(neigh->jp_timer);
+ if (neigh->bfd_info)
+ pim_bfd_info_free(&neigh->bfd_info);
+
XFREE(MTYPE_PIM_NEIGHBOR, neigh);
}
return listnode_head(pim_ifp->pim_neighbor_list);
}
-/* rpf info associated with an upstream entry needs to be re-evaluated
- * when an RPF neighbor comes or goes */
-static void pim_neighbor_rpf_update(void)
-{
- /* XXX: for the time being piggyback on the timer used on rib changes
- * to scan and update the rpf nexthop. This is expensive processing
- * and we should be able to optimize neighbor changes differently than
- * nexthop changes. */
- sched_rpf_cache_refresh();
-}
-
struct pim_neighbor *
pim_neighbor_add(struct interface *ifp, struct in_addr source_addr,
pim_hello_options hello_options, uint16_t holdtime,
else
pim_hello_restart_triggered(neigh->interface);
- pim_upstream_find_new_rpf();
+ pim_upstream_find_new_rpf(pim_ifp->pim);
/* RNH can send nexthop update prior to PIM neibhor UP
in that case nexthop cache would not consider this neighbor
Upon PIM neighbor UP, iterate all RPs and update
nexthop cache with this neighbor.
*/
- pim_resolve_rp_nh();
+ pim_resolve_rp_nh(pim_ifp->pim);
- pim_rp_setup();
+ pim_rp_setup(pim_ifp->pim);
- pim_neighbor_rpf_update();
+ sched_rpf_cache_refresh(pim_ifp->pim);
return neigh;
}
pim_neighbor_free(neigh);
- pim_neighbor_rpf_update();
+ sched_rpf_cache_refresh(pim_ifp->pim);
}
void pim_neighbor_delete_all(struct interface *ifp, const char *delete_message)
if (neigh->prefix_list == addr_list) {
if (addr_list) {
- zlog_err(
+ flog_err(
+ EC_LIB_DEVELOPMENT,
"%s: internal error: trying to replace same prefix list=%p",
__PRETTY_FUNCTION__, (void *)addr_list);
}