From 372eab92a2b286e03b57035dd66a3fce3f42e60a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 31 Oct 2016 08:44:01 -0400 Subject: [PATCH] pimd: Convert pim_joinprune_send to receive upstream When sending a join/prune send in the upstream pointer. this will allow us to implement some of the other state machines necessary. Signed-off-by: Donald Sharp --- pimd/pim_ifchannel.c | 2 +- pimd/pim_join.c | 8 ++++---- pimd/pim_join.h | 2 +- pimd/pim_upstream.c | 6 +++--- pimd/pim_zebra.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index ee09bf4fcb..96546f1da8 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -493,7 +493,7 @@ static int on_ifjoin_prune_pending_timer(struct thread *t) if (send_prune_echo) pim_joinprune_send (ifp, pim_ifp->primary_address, - &sg, 0); + ch->upstream, 0); return 0; } diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 0490efda9e..b4dd8e1466 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -395,7 +395,7 @@ int pim_joinprune_recv(struct interface *ifp, int pim_joinprune_send(struct interface *ifp, struct in_addr upstream_addr, - struct prefix_sg *sg, + struct pim_upstream *up, int send_join) { struct pim_interface *pim_ifp; @@ -421,7 +421,7 @@ int pim_joinprune_send(struct interface *ifp, zlog_debug("%s: sending %s(S,G)=%s to upstream=%s on interface %s", __PRETTY_FUNCTION__, send_join ? "Join" : "Prune", - pim_str_sg_dump (sg), dst_str, ifp->name); + pim_str_sg_dump (&up->sg), dst_str, ifp->name); } if (PIM_INADDR_IS_ANY(upstream_addr)) { @@ -431,7 +431,7 @@ int pim_joinprune_send(struct interface *ifp, zlog_debug("%s: %s(S,G)=%s: upstream=%s is myself on interface %s", __PRETTY_FUNCTION__, send_join ? "Join" : "Prune", - pim_str_sg_dump (sg), dst_str, ifp->name); + pim_str_sg_dump (&up->sg), dst_str, ifp->name); } return 0; } @@ -451,7 +451,7 @@ int pim_joinprune_send(struct interface *ifp, Build PIM message */ pim_msg_size = pim_msg_join_prune_encode (pim_msg, 1000, send_join, - sg->src, sg->grp, + up->sg.src, up->sg.grp, upstream_addr, PIM_JP_HOLDTIME); if (pim_msg_size < 0) diff --git a/pimd/pim_join.h b/pimd/pim_join.h index e6bddf31be..fadb613592 100644 --- a/pimd/pim_join.h +++ b/pimd/pim_join.h @@ -35,7 +35,7 @@ int pim_joinprune_recv(struct interface *ifp, int pim_joinprune_send(struct interface *ifp, struct in_addr upstream_addr, - struct prefix_sg *sg, + struct pim_upstream *up, int send_join); #endif /* PIM_JOIN_H */ diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 7264c0de55..cb5d9bcb28 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -212,7 +212,7 @@ pim_upstream_send_join (struct pim_upstream *up) /* send Join(S,G) to the current upstream neighbor */ pim_joinprune_send(up->rpf.source_nexthop.interface, up->rpf.rpf_addr.u.prefix4, - &up->sg, + up, 1 /* join */); } @@ -481,7 +481,7 @@ pim_upstream_switch(struct pim_upstream *up, forward_off(up); pim_joinprune_send(up->rpf.source_nexthop.interface, up->rpf.rpf_addr.u.prefix4, - &up->sg, + up, 0 /* prune */); if (up->t_join_timer) THREAD_OFF(up->t_join_timer); @@ -898,7 +898,7 @@ pim_upstream_keep_alive_timer (struct thread *t) THREAD_OFF (up->t_rs_timer); THREAD_OFF (up->t_join_timer); pim_joinprune_send (up->rpf.source_nexthop.interface, up->rpf.rpf_addr.u.prefix4, - &up->sg, 0); + up, 0); PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM (up->flags); if (PIM_UPSTREAM_FLAG_TEST_CREATED_BY_UPSTREAM(up->flags)) { diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index e2a71c6e7f..3189024f84 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -400,12 +400,12 @@ static void scan_upstream_rpf_cache() /* send Prune(S,G) to the old upstream neighbor */ pim_joinprune_send(old_interface, old_rpf_addr, - &up->sg, 0 /* prune */); + up, 0 /* prune */); /* send Join(S,G) to the current upstream neighbor */ pim_joinprune_send(up->rpf.source_nexthop.interface, up->rpf.rpf_addr.u.prefix4, - &up->sg, + up, 1 /* join */); pim_upstream_join_timer_restart(up); -- 2.39.5