diff options
| author | Sai Gomathi N <nsaigomathi@vmware.com> | 2023-03-17 03:51:16 -0700 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2023-05-02 15:56:34 +0000 |
| commit | eaf0abf7b65d813a19f879714ed8b0d33debc672 (patch) | |
| tree | 7b3e93956bfba6c4186bb08c617e55c545331ebf /pimd/pim_oil.c | |
| parent | e7dddd66b4c0707a15ff55f03c933afd97f80115 (diff) | |
pimd: PIM not sending register packets after changing from non DR to DR
When the router is non dr for an interface, it installs mroute to drop
the packets from directly connected source. This was done to avoid packets
coming to cpu as nocache hit. Later when it gets change from non-DR to DR,
these entries are not cleared. So the packets are still dropped.
This causes register packets not getting generated.
So cleaning up the mroute entries and channel oil without
upstream reference which was created to drop.
Co-authored-by: Saravanan K <saravanank@vmware.com>
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
(cherry picked from commit 1c883aef96013753f5467ba5e5028dee0f0a82c5)
Diffstat (limited to 'pimd/pim_oil.c')
| -rw-r--r-- | pimd/pim_oil.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c index 3bfb31e0c6..5c8d816406 100644 --- a/pimd/pim_oil.c +++ b/pimd/pim_oil.c @@ -162,6 +162,31 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim, return c_oil; } + +/* + * Clean up mroute and channel oil created for dropping pkts from directly + * connected source when the interface was non DR. + */ +void pim_clear_nocache_state(struct pim_interface *pim_ifp) +{ + struct channel_oil *c_oil; + + frr_each_safe (rb_pim_oil, &pim_ifp->pim->channel_oil_head, c_oil) { + + if ((!c_oil->up) || + !(PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(c_oil->up->flags))) + continue; + + if (*oil_parent(c_oil) != pim_ifp->mroute_vif_index) + continue; + + THREAD_OFF(c_oil->up->t_ka_timer); + PIM_UPSTREAM_FLAG_UNSET_SRC_NOCACHE(c_oil->up->flags); + PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(c_oil->up->flags); + pim_upstream_del(pim_ifp->pim, c_oil->up, __func__); + } +} + struct channel_oil *pim_channel_oil_del(struct channel_oil *c_oil, const char *name) { |
