summaryrefslogtreecommitdiffstats
path: root/pimd/pim_join.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-05-12 21:05:46 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2017-05-18 23:36:25 +0200
commitee22bbae78d0a17c0f34da106f77ba2fd80e6b0d (patch)
treece348e7fe2c83258799ae8eb89f93bf9cda3e1c0 /pimd/pim_join.c
parentpimd: Fix indentation issue that is causing clang unhappiness (diff)
downloadfrr-ee22bbae78d0a17c0f34da106f77ba2fd80e6b0d.tar.xz
frr-ee22bbae78d0a17c0f34da106f77ba2fd80e6b0d.zip
pimd: Fix to Tx S,G Join when SGRpt->Join state
-Upon Rx (*,G) Join w/o SGRpt at RP, trigger (S,G) Join towards FHR, unset SGRpt flag from channel, add (*,G) oif to (S,G) entry. -Add I am not RP check to triger SGRpt on *,G path otherwise, send S,G Prune on SPT path from RP to FHR upon receving *,G Prune. -Upon Rx SGRpt receive, remove OIF(downstream where Prune received) from specific S,G. Testing Done: pim-smoke Ran 95 tests in 11790.552s FAILED (SKIP=10, failures=4) Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_join.c')
-rw-r--r--pimd/pim_join.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 828781a46..2da0b9935 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -215,7 +215,8 @@ int pim_joinprune_recv(struct interface *ifp,
uint16_t msg_num_joined_sources;
uint16_t msg_num_pruned_sources;
int source;
- struct pim_ifchannel *ch = NULL;
+ struct pim_ifchannel *starg_ch = NULL, *sg_ch = NULL;
+ uint8_t starg_alone = 0;
memset (&sg, 0, sizeof (struct prefix_sg));
addr_offset = pim_parse_addr_group (&sg,
@@ -274,9 +275,10 @@ int pim_joinprune_recv(struct interface *ifp,
if (sg.src.s_addr == INADDR_ANY)
{
- ch = pim_ifchannel_find (ifp, &sg);
- if (ch)
- pim_ifchannel_set_star_g_join_state (ch, 0, msg_source_flags, 1);
+ starg_alone = 1;
+ starg_ch = pim_ifchannel_find (ifp, &sg);
+ if (starg_ch)
+ pim_ifchannel_set_star_g_join_state (starg_ch, 0, msg_source_flags, 1, starg_alone);
}
}
@@ -289,16 +291,33 @@ int pim_joinprune_recv(struct interface *ifp,
return -8;
}
- buf += addr_offset;
+ 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);
+
+ /* Received SG-RPT Prune delete oif from specific S,G */
+ if (starg_ch && sg_ch && (msg_source_flags & PIM_RPT_BIT_MASK)
+ && !(msg_source_flags & PIM_WILDCARD_BIT_MASK))
+ {
+ struct pim_upstream *up = sg_ch->upstream;
+ PIM_IF_FLAG_SET_S_G_RPT(sg_ch->flags);
+ if (up)
+ {
+ if (PIM_DEBUG_TRACE)
+ zlog_debug ("%s: SGRpt flag is set, del inherit oif from up %s",
+ __PRETTY_FUNCTION__, up->sg_str);
+ pim_channel_del_oif (up->channel_oil, starg_ch->interface, PIM_OIF_FLAG_PROTO_STAR);
+ }
+ }
}
- if (ch)
- pim_ifchannel_set_star_g_join_state (ch, 1, msg_source_flags, 0);
- ch = NULL;
+ if (starg_ch)
+ pim_ifchannel_set_star_g_join_state (starg_ch, 1, msg_source_flags, 0, starg_alone);
+ starg_ch = NULL;
} /* scan groups */
return 0;
@@ -502,6 +521,10 @@ int pim_joinprune_send(struct pim_rpf *rpf,
packet_size += group_size;
pim_msg_build_jp_groups (grp, group, group_size);
+ if (PIM_DEBUG_PIM_TRACE)
+ zlog_debug ("%s: interface %s num_joins %u num_prunes %u", __PRETTY_FUNCTION__,
+ rpf->source_nexthop.interface->name, ntohs(grp->joins), ntohs (grp->prunes));
+
grp = (struct pim_jp_groups *)curr_ptr;
if (packet_left < sizeof (struct pim_jp_groups) || msg->num_groups == 255)
{