summaryrefslogtreecommitdiff
path: root/pimd/pim_mroute.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-03-22 21:07:57 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-04-05 12:38:12 -0400
commit850a9f99b8e4ba6e043a75c28d25c9cb092770c5 (patch)
tree11bf752d7017eb0a5107873ea9ae9e8a77887edf /pimd/pim_mroute.c
parent0e374d906d8934e6054a54906449f83a3deefd71 (diff)
pimd: Allow SPT switchover
This allows SPT switchover for S,G upon receipt of packets on the LHR. 1) When we create a *,G from a IGMP Group Report, install the *,G route with the pimreg device on the OIL. 2) When a packet hits the LHR that matches the *,G, we will get a WHOLEPKT callback from the kernel and if we cannot find the S,G, that means we have matched it on the LHR via the *,G mroute. Create the S,G start the KAT and run inherited_olist. 3) When the S,G times out, safely remove the S,G via the KAT expiry 4) When the *,G is removed, remove any S,G associated with it via the LHR flag. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_mroute.c')
-rw-r--r--pimd/pim_mroute.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index 2fb243b9bd..cfbd07ede0 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -200,6 +200,23 @@ pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const char *buf)
up = pim_upstream_find(&sg);
if (!up) {
+ struct prefix_sg star = sg;
+ star.src.s_addr = INADDR_ANY;
+
+ up = pim_upstream_find(&star);
+
+ if (up && PIM_UPSTREAM_FLAG_TEST_SRC_IGMP(up->flags))
+ {
+ up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_LHR, __PRETTY_FUNCTION__);
+ pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
+ pim_upstream_inherited_olist (up);
+ pim_upstream_switch(up, PIM_UPSTREAM_JOINED);
+
+ if (PIM_DEBUG_MROUTE)
+ zlog_debug ("%s: Creating %s upstream on LHR",
+ __PRETTY_FUNCTION__, up->sg_str);
+ return 0;
+ }
if (PIM_DEBUG_MROUTE_DETAIL) {
zlog_debug("%s: Unable to find upstream channel WHOLEPKT%s",
__PRETTY_FUNCTION__, pim_str_sg_dump (&sg));