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];
}
}
- 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)) {
ospf_external_lsa_refresh(ospf, new, &ei_aggr,
LSA_REFRESH_FORCE, true);
+ SET_FLAG(aggr->flags,
+ OSPF_EXTERNAL_AGGRT_ORIGINATED);
} else
ospf_lsa_flush_as(ospf, new);
}
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);
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__);
}
/* 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;
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);