summaryrefslogtreecommitdiff
path: root/pimd/pim_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_join.c')
-rw-r--r--pimd/pim_join.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 9bc5c2d9cc..c60e5a65aa 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -64,9 +64,9 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
zlog_warn(
"%s: join (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
__PRETTY_FUNCTION__, pim_str_sg_dump(sg),
- source_flags & PIM_RPT_BIT_MASK,
- source_flags & PIM_WILDCARD_BIT_MASK, up_str, holdtime,
- neigh_str, ifp->name);
+ !!(source_flags & PIM_RPT_BIT_MASK),
+ !!(source_flags & PIM_WILDCARD_BIT_MASK), up_str,
+ holdtime, neigh_str, ifp->name);
}
pim_ifp = ifp->info;
@@ -80,14 +80,26 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
*/
if ((source_flags & PIM_RPT_BIT_MASK)
&& (source_flags & PIM_WILDCARD_BIT_MASK)) {
- struct pim_rpf *rp = RP(sg->grp);
+ struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
/*
* If the RP sent in the message is not
* our RP for the group, drop the message
*/
- if (sg->src.s_addr != rp->rpf_addr.u.prefix4.s_addr)
+ if (sg->src.s_addr != rp->rpf_addr.u.prefix4.s_addr) {
+ char received_rp[INET_ADDRSTRLEN];
+ char local_rp[INET_ADDRSTRLEN];
+ pim_inet4_dump("<received?>", sg->src, received_rp,
+ sizeof(received_rp));
+ pim_inet4_dump("<local?>", rp->rpf_addr.u.prefix4,
+ local_rp, sizeof(local_rp));
+ if (PIM_DEBUG_PIM_TRACE)
+ zlog_warn(
+ "%s: Specified RP(%s) in join is different than our configured RP(%s)",
+ __PRETTY_FUNCTION__, received_rp,
+ local_rp);
return;
+ }
sg->src.s_addr = INADDR_ANY;
}
@@ -124,7 +136,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
if ((source_flags & PIM_RPT_BIT_MASK)
&& (source_flags & PIM_WILDCARD_BIT_MASK)) {
- struct pim_rpf *rp = RP(sg->grp);
+ struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
// Ignoring Prune *,G's at the moment.
if (sg->src.s_addr != rp->rpf_addr.u.prefix4.s_addr)
@@ -294,14 +306,20 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
return -8;
}
- sg_ch = pim_ifchannel_find(ifp, &sg);
-
buf += addr_offset;
starg_alone = 0;
recv_prune(ifp, neigh, msg_holdtime,
msg_upstream_addr.u.prefix4, &sg,
msg_source_flags);
+ /*
+ * So if we are receiving a S,G,RPT prune
+ * before we have any data for that S,G
+ * We need to retrieve the sg_ch after
+ * we parse the prune.
+ */
+ sg_ch = pim_ifchannel_find(ifp, &sg);
+
/* Received SG-RPT Prune delete oif from specific S,G */
if (starg_ch && sg_ch
&& (msg_source_flags & PIM_RPT_BIT_MASK)