From: Donald Sharp Date: Wed, 13 Jul 2016 18:22:42 +0000 (-0400) Subject: pimd: Allow (S,G) pimreg route to time out X-Git-Tag: frr-2.0-rc1~468 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=25a335e0cadc62946c615a102a6cbf2d2ec6ba55;p=mirror%2Ffrr.git pimd: Allow (S,G) pimreg route to time out When a kernel upcall happens for nocache we create a (S,G) route to be installed into the kernel. This code modification starts the ability to time out the mroute if we stop receiving mcast packets. Ticket: CM-11793 Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index e1da3c6101..ab3742438d 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -156,6 +156,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg } return 0; } + up->channel_oil->cc.pktcnt++; pim_channel_add_oif(up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_SOURCE); diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index cb2619abb7..8267885756 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -59,7 +59,7 @@ static void upstream_channel_oil_detach(struct pim_upstream *up) { if (up->channel_oil) { pim_channel_oil_del(up->channel_oil); - up->channel_oil = 0; + up->channel_oil = NULL; } } @@ -715,12 +715,29 @@ pim_upstream_keep_alive_timer (struct thread *t) up = THREAD_ARG(t); - pim_br_clear_pmbr (up->source_addr, up->group_addr); - /* - * We need to do more here :) - * But this is the start. - */ + if (I_am_RP (up->group_addr)) + { + pim_br_clear_pmbr (up->source_addr, up->group_addr); + /* + * We need to do more here :) + * But this is the start. + */ + } + else + { + pim_mroute_update_counters (up->channel_oil); + if (up->channel_oil->cc.oldpktcnt >= up->channel_oil->cc.pktcnt) + { + pim_mroute_del (up->channel_oil); + pim_upstream_delete (up); + } + else + { + up->t_ka_timer = NULL; + pim_upstream_keep_alive_timer_start (up, PIM_KEEPALIVE_PERIOD); + } + } return 1; }