diff options
Diffstat (limited to 'pimd/pim_vxlan.c')
| -rw-r--r-- | pimd/pim_vxlan.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c index bff8017b43..569b04d278 100644 --- a/pimd/pim_vxlan.c +++ b/pimd/pim_vxlan.c @@ -85,8 +85,16 @@ static void pim_vxlan_do_reg_work(void) if (PIM_DEBUG_VXLAN) zlog_debug("vxlan SG %s periodic NULL register", vxlan_sg->sg_str); - pim_null_register_send(vxlan_sg->up); - ++work_cnt; + + /* + * If we are on the work queue *and* the rpf + * has been lost on the vxlan_sg->up let's + * make sure that we don't send it. + */ + if (vxlan_sg->up->rpf.source_nexthop.interface) { + pim_null_register_send(vxlan_sg->up); + ++work_cnt; + } } if (work_cnt > vxlan_info.max_work_cnt) { @@ -217,6 +225,7 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg) vxlan_sg->sg_str); vxlan_sg->up = NULL; + if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_ORIG) { /* clear out all the vxlan properties */ up->flags &= ~(PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_ORIG | @@ -754,14 +763,8 @@ struct pim_vxlan_sg *pim_vxlan_sg_add(struct pim_instance *pim, return vxlan_sg; } -void pim_vxlan_sg_del(struct pim_instance *pim, struct prefix_sg *sg) +static void pim_vxlan_sg_del_item(struct pim_vxlan_sg *vxlan_sg) { - struct pim_vxlan_sg *vxlan_sg; - - vxlan_sg = pim_vxlan_sg_find(pim, sg); - if (!vxlan_sg) - return; - vxlan_sg->flags |= PIM_VXLAN_SGF_DEL_IN_PROG; pim_vxlan_del_work(vxlan_sg); @@ -771,14 +774,24 @@ void pim_vxlan_sg_del(struct pim_instance *pim, struct prefix_sg *sg) else pim_vxlan_term_mr_del(vxlan_sg); - hash_release(vxlan_sg->pim->vxlan.sg_hash, vxlan_sg); - if (PIM_DEBUG_VXLAN) zlog_debug("vxlan SG %s free", vxlan_sg->sg_str); XFREE(MTYPE_PIM_VXLAN_SG, vxlan_sg); } +void pim_vxlan_sg_del(struct pim_instance *pim, struct prefix_sg *sg) +{ + struct pim_vxlan_sg *vxlan_sg; + + vxlan_sg = pim_vxlan_sg_find(pim, sg); + if (!vxlan_sg) + return; + + pim_vxlan_sg_del_item(vxlan_sg); + hash_release(pim->vxlan.sg_hash, vxlan_sg); +} + /******************************* MLAG handling *******************************/ bool pim_vxlan_do_mlag_reg(void) { @@ -1153,8 +1166,14 @@ void pim_vxlan_init(struct pim_instance *pim) void pim_vxlan_exit(struct pim_instance *pim) { if (pim->vxlan.sg_hash) { - hash_clean(pim->vxlan.sg_hash, NULL); + hash_clean(pim->vxlan.sg_hash, + (void (*)(void *))pim_vxlan_sg_del_item); hash_free(pim->vxlan.sg_hash); pim->vxlan.sg_hash = NULL; } } + +void pim_vxlan_terminate(void) +{ + pim_vxlan_work_timer_setup(false); +} |
