diff options
author | sarita patra <saritap@vmware.com> | 2022-04-27 10:21:23 +0200 |
---|---|---|
committer | Sarita Patra <saritap@vmware.com> | 2022-07-06 11:41:47 +0200 |
commit | 028583e9e096cac6c6ae16afa14c72f016cb8c0c (patch) | |
tree | 2d8b5f2de59e4ee12c60b55c5bb0b70a8ca42d2f /pimd/pim_upstream.c | |
parent | pim6d: Adjust rpf_addr in rp_info (diff) | |
download | frr-028583e9e096cac6c6ae16afa14c72f016cb8c0c.tar.xz frr-028583e9e096cac6c6ae16afa14c72f016cb8c0c.zip |
pim6d: Adjust rpf_addr in pim_upstream
In this PR, we are handling the pim_upstream
after rpf_addr modified from prefix to pim_addr.
Signed-off-by: sarita patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_upstream.c')
-rw-r--r-- | pimd/pim_upstream.c | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 54a7f59ca..8190162a2 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -192,7 +192,6 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim, struct listnode *node, *nnode; struct pim_ifchannel *ch; bool notify_msdp = false; - struct prefix nht_p; if (PIM_DEBUG_PIM_TRACE) zlog_debug( @@ -267,12 +266,11 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim, */ if (!pim_addr_is_any(up->upstream_addr)) { /* Deregister addr with Zebra NHT */ - pim_addr_to_prefix(&nht_p, up->upstream_addr); if (PIM_DEBUG_PIM_TRACE) zlog_debug( - "%s: Deregister upstream %s addr %pFX with Zebra NHT", - __func__, up->sg_str, &nht_p); - pim_delete_tracked_nexthop(pim, &nht_p, up, NULL); + "%s: Deregister upstream %s addr %pPA with Zebra NHT", + __func__, up->sg_str, &up->upstream_addr); + pim_delete_tracked_nexthop(pim, &up->upstream_addr, up, NULL); } XFREE(MTYPE_PIM_UPSTREAM, up); @@ -290,16 +288,13 @@ void pim_upstream_send_join(struct pim_upstream *up) } if (PIM_DEBUG_PIM_TRACE) { - char rpf_str[PREFIX_STRLEN]; - pim_addr_dump("<rpf?>", &up->rpf.rpf_addr, rpf_str, - sizeof(rpf_str)); - zlog_debug("%s: RPF'%s=%s(%s) for Interface %s", __func__, - up->sg_str, rpf_str, + zlog_debug("%s: RPF'%s=%pPA(%s) for Interface %s", __func__, + up->sg_str, &up->rpf.rpf_addr, pim_upstream_state2str(up->join_state), up->rpf.source_nexthop.interface->name); if (pim_rpf_addr_is_inaddr_any(&up->rpf)) { - zlog_debug("%s: can't send join upstream: RPF'%s=%s", - __func__, up->sg_str, rpf_str); + zlog_debug("%s: can't send join upstream: RPF'%s=%pPA", + __func__, up->sg_str, &up->rpf.rpf_addr); /* warning only */ } } @@ -345,8 +340,8 @@ static void join_timer_stop(struct pim_upstream *up) THREAD_OFF(up->t_join_timer); if (up->rpf.source_nexthop.interface) - nbr = pim_neighbor_find_prefix(up->rpf.source_nexthop.interface, - &up->rpf.rpf_addr); + nbr = pim_neighbor_find(up->rpf.source_nexthop.interface, + up->rpf.rpf_addr); if (nbr) pim_jp_agg_remove_group(nbr->upstream_jp_agg, up, nbr); @@ -359,8 +354,8 @@ void join_timer_start(struct pim_upstream *up) struct pim_neighbor *nbr = NULL; if (up->rpf.source_nexthop.interface) { - nbr = pim_neighbor_find_prefix(up->rpf.source_nexthop.interface, - &up->rpf.rpf_addr); + nbr = pim_neighbor_find(up->rpf.source_nexthop.interface, + up->rpf.rpf_addr); if (PIM_DEBUG_PIM_EVENTS) { zlog_debug( @@ -428,7 +423,7 @@ void pim_update_suppress_timers(uint32_t suppress_time) } } -void pim_upstream_join_suppress(struct pim_upstream *up, struct prefix rpf, +void pim_upstream_join_suppress(struct pim_upstream *up, pim_addr rpf, int holdtime) { long t_joinsuppress_msec; @@ -451,23 +446,19 @@ void pim_upstream_join_suppress(struct pim_upstream *up, struct prefix rpf, pim_time_timer_remain_msec(up->t_join_timer); else { /* Remove it from jp agg from the nbr for suppression */ - nbr = pim_neighbor_find_prefix(up->rpf.source_nexthop.interface, - &up->rpf.rpf_addr); + nbr = pim_neighbor_find(up->rpf.source_nexthop.interface, + up->rpf.rpf_addr); if (nbr) { join_timer_remain_msec = pim_time_timer_remain_msec(nbr->jp_timer); } } - if (PIM_DEBUG_PIM_TRACE) { - char rpf_str[INET_ADDRSTRLEN]; - - pim_addr_dump("<rpf?>", &rpf, rpf_str, sizeof(rpf_str)); + if (PIM_DEBUG_PIM_TRACE) zlog_debug( - "%s %s: detected Join%s to RPF'(S,G)=%s: join_timer=%ld msec t_joinsuppress=%ld msec", - __FILE__, __func__, up->sg_str, rpf_str, + "%s %s: detected Join%s to RPF'(S,G)=%pPA: join_timer=%ld msec t_joinsuppress=%ld msec", + __FILE__, __func__, up->sg_str, &rpf, join_timer_remain_msec, t_joinsuppress_msec); - } if (join_timer_remain_msec < t_joinsuppress_msec) { if (PIM_DEBUG_PIM_TRACE) { @@ -507,8 +498,8 @@ void pim_upstream_join_timer_decrease_to_t_override(const char *debug_label, /* upstream join tracked with neighbor jp timer */ struct pim_neighbor *nbr; - nbr = pim_neighbor_find_prefix(up->rpf.source_nexthop.interface, - &up->rpf.rpf_addr); + nbr = pim_neighbor_find(up->rpf.source_nexthop.interface, + up->rpf.rpf_addr); if (nbr) join_timer_remain_msec = pim_time_timer_remain_msec(nbr->jp_timer); @@ -517,17 +508,11 @@ void pim_upstream_join_timer_decrease_to_t_override(const char *debug_label, join_timer_remain_msec = t_override_msec + 1; } - if (PIM_DEBUG_PIM_TRACE) { - char rpf_str[INET_ADDRSTRLEN]; - - pim_addr_dump("<rpf?>", &up->rpf.rpf_addr, rpf_str, - sizeof(rpf_str)); - + if (PIM_DEBUG_PIM_TRACE) zlog_debug( - "%s: to RPF'%s=%s: join_timer=%ld msec t_override=%d msec", - debug_label, up->sg_str, rpf_str, + "%s: to RPF'%s=%pPA: join_timer=%ld msec t_override=%d msec", + debug_label, up->sg_str, &up->rpf.rpf_addr, join_timer_remain_msec, t_override_msec); - } if (join_timer_remain_msec > t_override_msec) { if (PIM_DEBUG_PIM_TRACE) { @@ -842,9 +827,7 @@ void pim_upstream_fill_static_iif(struct pim_upstream *up, up->rpf.source_nexthop.mrib_metric_preference = ZEBRA_CONNECT_DISTANCE_DEFAULT; up->rpf.source_nexthop.mrib_route_metric = 0; - up->rpf.rpf_addr.family = AF_INET; - up->rpf.rpf_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY; - + up->rpf.rpf_addr = PIMADDR_ANY; } static struct pim_upstream *pim_upstream_new(struct pim_instance *pim, @@ -903,7 +886,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim, router->infinite_assert_metric.metric_preference; up->rpf.source_nexthop.mrib_route_metric = router->infinite_assert_metric.route_metric; - pim_addr_to_prefix(&up->rpf.rpf_addr, PIMADDR_ANY); + up->rpf.rpf_addr = PIMADDR_ANY; up->ifchannels = list_new(); up->ifchannels->cmp = (int (*)(void *, void *))pim_ifchannel_compare; @@ -1070,7 +1053,7 @@ struct pim_upstream *pim_upstream_add(struct pim_instance *pim, pim_sgaddr *sg, if (PIM_DEBUG_PIM_TRACE) { if (up) - zlog_debug("%s(%s): %s, iif %pFX (%s) found: %d: ref_count: %d", + zlog_debug("%s(%s): %s, iif %pPA (%s) found: %d: ref_count: %d", __func__, name, up->sg_str, &up->rpf.rpf_addr, up->rpf.source_nexthop.interface ? up->rpf.source_nexthop.interface->name : "Unknown" , @@ -1274,7 +1257,7 @@ void pim_upstream_rpf_genid_changed(struct pim_instance *pim, frr_each (rb_pim_upstream, &pim->upstream_head, up) { pim_addr rpf_addr; - rpf_addr = pim_addr_from_prefix(&up->rpf.rpf_addr); + rpf_addr = up->rpf.rpf_addr; if (PIM_DEBUG_PIM_TRACE) zlog_debug( |