}
+static void pim_upstream_timers_stop(struct pim_upstream *up)
+{
+ THREAD_OFF(up->t_ka_timer);
+ THREAD_OFF(up->t_rs_timer);
+ THREAD_OFF(up->t_msdp_reg_timer);
+ THREAD_OFF(up->t_join_timer);
+}
+
struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
struct pim_upstream *up, const char *name)
{
if (pim_up_mlag_is_local(up))
pim_mlag_up_local_del(pim, up);
- THREAD_OFF(up->t_ka_timer);
- THREAD_OFF(up->t_rs_timer);
- THREAD_OFF(up->t_msdp_reg_timer);
+ pim_upstream_timers_stop(up);
if (up->join_state == PIM_UPSTREAM_JOINED) {
pim_jp_agg_single_upstream_send(&up->rpf, up, 0);
pim_jp_agg_single_upstream_send(&up->rpf, up, 1 /* join */);
}
-static int on_join_timer(struct thread *t)
+static void on_join_timer(struct thread *t)
{
struct pim_upstream *up;
if (PIM_DEBUG_PIM_TRACE)
zlog_debug("%s: up %s RPF is not present", __func__,
up->sg_str);
- return 0;
+ return;
}
/*
* In the case of a HFR we will not ahve anyone to send this to.
*/
if (PIM_UPSTREAM_FLAG_TEST_FHR(up->flags))
- return 0;
+ return;
/*
* Don't send the join if the outgoing interface is a loopback
pim_upstream_send_join(up);
join_timer_start(up);
-
- return 0;
}
static void join_timer_stop(struct pim_upstream *up)
}
}
-void pim_upstream_join_suppress(struct pim_upstream *up,
- struct in_addr rpf_addr, int holdtime)
+void pim_upstream_join_suppress(struct pim_upstream *up, struct prefix rpf,
+ int holdtime)
{
long t_joinsuppress_msec;
long join_timer_remain_msec = 0;
if (PIM_DEBUG_PIM_TRACE) {
char rpf_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<rpf?>", rpf_addr, rpf_str, sizeof(rpf_str));
+
+ pim_addr_dump("<rpf?>", &rpf, rpf_str, sizeof(rpf_str));
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,
if (PIM_DEBUG_PIM_TRACE) {
char rpf_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<rpf?>", up->rpf.rpf_addr.u.prefix4, rpf_str,
- sizeof(rpf_str));
+
+ pim_addr_dump("<rpf?>", &up->rpf.rpf_addr, rpf_str,
+ sizeof(rpf_str));
+
zlog_debug(
"%s: to RPF'%s=%s: join_timer=%ld msec t_override=%d msec",
debug_label, up->sg_str, rpf_str,
* 2. and along the RPT if SPTbit is not set
* If forwarding is hw accelerated i.e. control and dataplane components
* are separate you may not be able to reliably set SPT bit on intermediate
- * routers while still fowarding on the (S,G,rpt).
+ * routers while still forwarding on the (S,G,rpt).
*
* This macro is a slight deviation on the RFC and uses "traffic-agnostic"
* criteria to decide between using the RPT vs. SPT for forwarding.
up->rpf.source_nexthop.interface = incoming;
/* reset other parameters to matched a connected incoming interface */
- up->rpf.source_nexthop.mrib_nexthop_addr.family = AF_INET;
- up->rpf.source_nexthop.mrib_nexthop_addr.u.prefix4.s_addr =
- PIM_NET_INADDR_ANY;
+ up->rpf.source_nexthop.mrib_nexthop_addr = PIMADDR_ANY;
up->rpf.source_nexthop.mrib_metric_preference =
ZEBRA_CONNECT_DISTANCE_DEFAULT;
up->rpf.source_nexthop.mrib_route_metric = 0;
up->sptbit = PIM_UPSTREAM_SPTBIT_FALSE;
up->rpf.source_nexthop.interface = NULL;
- up->rpf.source_nexthop.mrib_nexthop_addr.family = AF_INET;
- up->rpf.source_nexthop.mrib_nexthop_addr.u.prefix4.s_addr =
- PIM_NET_INADDR_ANY;
+ up->rpf.source_nexthop.mrib_nexthop_addr = PIMADDR_ANY;
up->rpf.source_nexthop.mrib_metric_preference =
router->infinite_assert_metric.metric_preference;
up->rpf.source_nexthop.mrib_route_metric =
router->infinite_assert_metric.route_metric;
- up->rpf.rpf_addr.family = AF_INET;
- up->rpf.rpf_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY;
-
+ pim_addr_to_prefix(&up->rpf.rpf_addr, PIMADDR_ANY);
up->ifchannels = list_new();
up->ifchannels->cmp = (int (*)(void *, void *))pim_ifchannel_compare;
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug(
- "%s: Created Upstream %s upstream_addr %pI4 ref count %d increment",
+ "%s: Created Upstream %s upstream_addr %pPAs ref count %d increment",
__func__, up->sg_str, &up->upstream_addr,
up->ref_count);
}
it so that it expires after t_override seconds.
*/
void pim_upstream_rpf_genid_changed(struct pim_instance *pim,
- struct in_addr neigh_addr)
+ pim_addr neigh_addr)
{
struct pim_upstream *up;
* Scan all (S,G) upstreams searching for RPF'(S,G)=neigh_addr
*/
frr_each (rb_pim_upstream, &pim->upstream_head, up) {
- if (PIM_DEBUG_PIM_TRACE) {
- char rpf_addr_str[PREFIX_STRLEN];
- pim_addr_dump("<rpf?>", &up->rpf.rpf_addr, rpf_addr_str,
- sizeof(rpf_addr_str));
+ pim_addr rpf_addr;
+
+ rpf_addr = pim_addr_from_prefix(&up->rpf.rpf_addr);
+
+ if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
- "%s: matching neigh=%pI4 against upstream (S,G)=%s[%s] joined=%d rpf_addr=%s",
+ "%s: matching neigh=%pPA against upstream (S,G)=%s[%s] joined=%d rpf_addr=%pPA",
__func__, &neigh_addr, up->sg_str,
pim->vrf->name,
up->join_state == PIM_UPSTREAM_JOINED,
- rpf_addr_str);
- }
+ &rpf_addr);
/* consider only (S,G) upstream in Joined state */
if (up->join_state != PIM_UPSTREAM_JOINED)
continue;
/* match RPF'(S,G)=neigh_addr */
- if (up->rpf.rpf_addr.u.prefix4.s_addr != neigh_addr.s_addr)
+ if (pim_addr_cmp(rpf_addr, neigh_addr))
continue;
pim_upstream_join_timer_decrease_to_t_override(
return up;
}
-static int pim_upstream_keep_alive_timer(struct thread *t)
+static void pim_upstream_keep_alive_timer(struct thread *t)
{
struct pim_upstream *up;
/* pull the stats and re-check */
if (pim_upstream_sg_running_proc(up))
/* kat was restarted because of new activity */
- return 0;
+ return;
pim_upstream_keep_alive_timer_proc(up);
- return 0;
}
void pim_upstream_keep_alive_timer_start(struct pim_upstream *up, uint32_t time)
}
/* MSDP on RP needs to know if a source is registerable to this RP */
-static int pim_upstream_msdp_reg_timer(struct thread *t)
+static void pim_upstream_msdp_reg_timer(struct thread *t)
{
struct pim_upstream *up = THREAD_ARG(t);
struct pim_instance *pim = up->channel_oil->pim;
/* source is no longer active - pull the SA from MSDP's cache */
pim_msdp_sa_local_del(pim, &up->sg);
- return 1;
}
+
void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up)
{
THREAD_OFF(up->t_msdp_reg_timer);
return state_str;
}
-static int pim_upstream_register_stop_timer(struct thread *t)
+static void pim_upstream_register_stop_timer(struct thread *t)
{
struct pim_interface *pim_ifp;
struct pim_instance *pim;
zlog_debug("%s: up %s RPF is not present",
__func__, up->sg_str);
up->reg_state = PIM_REG_NOINFO;
- return 0;
+ return;
}
pim_ifp = up->rpf.source_nexthop.interface->info;
"%s: Interface: %s is not configured for pim",
__func__,
up->rpf.source_nexthop.interface->name);
- return 0;
+ return;
}
up->reg_state = PIM_REG_JOIN_PENDING;
pim_upstream_start_register_stop_timer(up, 1);
zlog_debug(
"%s: Stop sending the register, because I am the RP and we haven't seen a packet in a while",
__func__);
- return 0;
+ return;
}
pim_null_register_send(up);
break;
case PIM_REG_NOINFO:
break;
}
-
- return 0;
}
void pim_upstream_start_register_stop_timer(struct pim_upstream *up,
flag = PIM_OIF_FLAG_PROTO_STAR;
else {
if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags))
- flag = PIM_OIF_FLAG_PROTO_IGMP;
+ flag = PIM_OIF_FLAG_PROTO_GM;
if (PIM_IF_FLAG_TEST_PROTO_PIM(ch->flags))
flag |= PIM_OIF_FLAG_PROTO_PIM;
if (starch)
struct pim_upstream *up;
while ((up = rb_pim_upstream_first(&pim->upstream_head))) {
- pim_upstream_del(pim, up, __func__);
+ if (pim_upstream_del(pim, up, __func__))
+ pim_upstream_timers_stop(up);
}
rb_pim_upstream_fini(&pim->upstream_head);
return false;
pim_ifp = ifp->info;
- if (pim_ifp->mroute_vif_index != c_oil->oil.mfcc_parent)
+ if (pim_ifp->mroute_vif_index != *oil_parent(c_oil))
return false;
if (pim_if_connected_to_source(up->rpf.source_nexthop.interface,
if ((up->sptbit != PIM_UPSTREAM_SPTBIT_TRUE) &&
(up->rpf.source_nexthop.interface)) {
pim_upstream_set_sptbit(up, up->rpf.source_nexthop.interface);
+ pim_upstream_update_could_assert(up);
}
return rv;
continue;
pim_channel_add_oif(up->channel_oil, pim->regiface,
- PIM_OIF_FLAG_PROTO_IGMP, __func__);
+ PIM_OIF_FLAG_PROTO_GM, __func__);
}
}
if (!nlist) {
pim_channel_del_oif(up->channel_oil, pim->regiface,
- PIM_OIF_FLAG_PROTO_IGMP, __func__);
+ PIM_OIF_FLAG_PROTO_GM, __func__);
continue;
}
pim_addr_to_prefix(&g, up->sg.grp);
apply_new = prefix_list_apply(np, &g);
if (apply_new == PREFIX_DENY)
pim_channel_add_oif(up->channel_oil, pim->regiface,
- PIM_OIF_FLAG_PROTO_IGMP,
- __func__);
+ PIM_OIF_FLAG_PROTO_GM, __func__);
else
pim_channel_del_oif(up->channel_oil, pim->regiface,
- PIM_OIF_FLAG_PROTO_IGMP, __func__);
+ PIM_OIF_FLAG_PROTO_GM, __func__);
}
}