diff options
| author | saravanank <saravanank@vmware.com> | 2020-03-19 18:05:11 -0700 |
|---|---|---|
| committer | saravanank <saravanank@vmware.com> | 2020-03-19 18:27:37 -0700 |
| commit | 46a9ea8bfa753472e786268ed97444b41ce94fa8 (patch) | |
| tree | 3e6e28b0d555ad523232fef445c63479c0b3a22f /pimd/pim_register.c | |
| parent | 7f2ccbe562cae49fb8bf1770a0ec79b701ee41af (diff) | |
pimd: When DR becomes non DR, couldreg state events not handled.
RCA: Upstreams which are in register state other than noinfo, doesnt remove
register tunnel from oif after it becomes nonDR
Fix: scan upstreams with iif as the old dr and check if couldReg becomes false.
If couldreg becomes false from true, remove regiface and stop reg timer.
Do not disturb the entry. Later the entry shall be removed by kat expiry.
Signed-off-by: Saravanan K <saravanank@vmware.com>
Diffstat (limited to 'pimd/pim_register.c')
| -rw-r--r-- | pimd/pim_register.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 19baecb9c2..92c3033718 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -498,3 +498,32 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr, return 0; } + +/* + * This routine scan all upstream and update register state and remove pimreg + * when couldreg becomes false. + */ +void pim_reg_del_on_couldreg_fail(struct interface *ifp) +{ + struct pim_interface *pim_ifp = ifp->info; + struct pim_instance *pim; + struct pim_upstream *up; + + if (!pim_ifp) + return; + + pim = pim_ifp->pim; + + frr_each (rb_pim_upstream, &pim->upstream_head, up) { + if (ifp != up->rpf.source_nexthop.interface) + continue; + + if (!pim_upstream_could_register(up) + && (up->reg_state != PIM_REG_NOINFO)) { + pim_channel_del_oif(up->channel_oil, pim->regiface, + PIM_OIF_FLAG_PROTO_PIM, __func__); + THREAD_OFF(up->t_rs_timer); + up->reg_state = PIM_REG_NOINFO; + } + } +} |
