From: Donald Sharp Date: Fri, 16 Jun 2017 19:23:49 +0000 (-0400) Subject: pimd: Add a check for needing spt bit in register_recv X-Git-Tag: frr-4.0-dev~468^2~37 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=cc61055f0ed2cb8521dd685b3456b503ef297190;p=mirror%2Ffrr.git pimd: Add a check for needing spt bit in register_recv When we receive a register message for an existing S,G and the SPT bit is not set, then do a quick check against the S,G to see if we have counters updated. This is added because the existing S,G wheel_timer only updates every 31 seconds and it is possible for a Null Register to have come in before that first 30 second timer pops. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 744bc8e94c..605dd43d5e 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -377,6 +377,28 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr, } upstream->upstream_register = src_addr; + } else { + /* + * If the FHR has set a very very fast register timer + * there exists a possibility that the incoming NULL + * register + * is happening before we set the spt bit. If so + * Do a quick check to update the counters and + * then set the spt bit as appropriate + */ + if (upstream->sptbit != PIM_UPSTREAM_SPTBIT_TRUE) { + pim_mroute_update_counters( + upstream->channel_oil); + /* + * Have we seen packets? + */ + if (upstream->channel_oil->cc.oldpktcnt + < upstream->channel_oil->cc.pktcnt) + pim_upstream_set_sptbit( + upstream, + upstream->rpf.source_nexthop + .interface); + } } if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)