diff options
Diffstat (limited to 'ospfd/ospf_flood.c')
| -rw-r--r-- | ospfd/ospf_flood.c | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index 6c1ac6761a..7fddb65a86 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -98,14 +98,14 @@ struct external_info *ospf_external_info_check(struct ospf *ospf, int redist_on = 0; redist_on = - is_prefix_default(&p) + is_default_prefix4(&p) ? vrf_bitmap_check( - zclient->default_information[AFI_IP], - ospf->vrf_id) + zclient->default_information[AFI_IP], + ospf->vrf_id) : (zclient->mi_redist[AFI_IP][type].enabled || vrf_bitmap_check( - zclient->redist[AFI_IP][type], - ospf->vrf_id)); + zclient->redist[AFI_IP][type], + ospf->vrf_id)); // Pending: check for MI above. if (redist_on) { ext_list = ospf->external[type]; @@ -128,7 +128,7 @@ struct external_info *ospf_external_info_check(struct ospf *ospf, } } - if (is_prefix_default(&p) && ospf->external[DEFAULT_ROUTE]) { + if (is_default_prefix4(&p) && ospf->external[DEFAULT_ROUTE]) { ext_list = ospf->external[DEFAULT_ROUTE]; for (ALL_LIST_ELEMENTS_RO(ext_list, node, ext)) { @@ -379,13 +379,13 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, SET_FLAG(new->flags, OSPF_LSA_RECEIVED); (void)ospf_lsa_is_self_originated(ospf, new); /* Let it set the flag */ - /* Received Grace LSA */ - if (IS_GRACE_LSA(new)) { + /* Received non-self-originated Grace LSA */ + if (IS_GRACE_LSA(new) && !IS_LSA_SELF(new)) { if (IS_LSA_MAXAGE(new)) { /* Handling Max age grace LSA.*/ - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Received a maxage GRACE-LSA from router %pI4", __func__, &new->data->adv_router); @@ -393,21 +393,21 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, if (current) { ospf_process_maxage_grace_lsa(ospf, new, nbr); } else { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Grace LSA doesn't exist in lsdb, so discarding grace lsa", __func__); return -1; } } else { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Received a GRACE-LSA from router %pI4", __func__, &new->data->adv_router); if (ospf_process_grace_lsa(ospf, new, nbr) == OSPF_GR_NOT_HELPER) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Not moving to HELPER role, So discarding grace LSA", __func__); @@ -445,9 +445,9 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, } /* OSPF LSA flooding -- RFC2328 Section 13.3. */ -static int ospf_flood_through_interface(struct ospf_interface *oi, - struct ospf_neighbor *inbr, - struct ospf_lsa *lsa) +int ospf_flood_through_interface(struct ospf_interface *oi, + struct ospf_neighbor *inbr, + struct ospf_lsa *lsa) { struct ospf_neighbor *onbr; struct route_node *rn; @@ -1031,25 +1031,50 @@ void ospf_ls_retransmit_delete_nbr_as(struct ospf *ospf, struct ospf_lsa *lsa) flushing an LSA from the whole domain. */ void ospf_lsa_flush_area(struct ospf_lsa *lsa, struct ospf_area *area) { + struct ospf *ospf = area->ospf; + + if (ospf_lsa_is_self_originated(ospf, lsa) + && ospf->gr_info.restart_in_progress) { + if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) + zlog_debug( + "%s:LSA[Type%d:%pI4]: Graceful Restart in progress -- not flushing self-originated LSA", + ospf_get_name(ospf), lsa->data->type, + &lsa->data->id); + return; + } + /* Reset the lsa origination time such that it gives more time for the ACK to be received and avoid retransmissions */ lsa->data->ls_age = htons(OSPF_LSA_MAXAGE); if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: MAXAGE set to LSA %pI4", __func__, - &lsa->data->id); + zlog_debug("%s: MaxAge set to LSA[%s]", __func__, + dump_lsa_key(lsa)); monotime(&lsa->tv_recv); lsa->tv_orig = lsa->tv_recv; ospf_flood_through_area(area, NULL, lsa); - ospf_lsa_maxage(area->ospf, lsa); + ospf_lsa_maxage(ospf, lsa); } void ospf_lsa_flush_as(struct ospf *ospf, struct ospf_lsa *lsa) { + if (ospf_lsa_is_self_originated(ospf, lsa) + && ospf->gr_info.restart_in_progress) { + if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) + zlog_debug( + "%s:LSA[Type%d:%pI4]: Graceful Restart in progress -- not flushing self-originated LSA", + ospf_get_name(ospf), lsa->data->type, + &lsa->data->id); + return; + } + /* Reset the lsa origination time such that it gives more time for the ACK to be received and avoid retransmissions */ lsa->data->ls_age = htons(OSPF_LSA_MAXAGE); + if (IS_DEBUG_OSPF_EVENT) + zlog_debug("%s: MaxAge set to LSA[%s]", __func__, + dump_lsa_key(lsa)); monotime(&lsa->tv_recv); lsa->tv_orig = lsa->tv_recv; ospf_flood_through_as(ospf, NULL, lsa); |
