diff options
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 574083ae02..e64a620f00 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2838,6 +2838,8 @@ static void process_subq_early_route_add(struct zebra_early_route *ere) if (!ere->startup && (re->flags & ZEBRA_FLAG_SELFROUTE) && zrouter.asic_offloaded) { + struct route_entry *entry; + if (!same) { if (IS_ZEBRA_DEBUG_RIB) zlog_debug( @@ -2854,6 +2856,25 @@ static void process_subq_early_route_add(struct zebra_early_route *ere) early_route_memory_free(ere); return; } + + RNODE_FOREACH_RE (rn, entry) { + if (CHECK_FLAG(entry->status, ROUTE_ENTRY_REMOVED)) + continue; + + if (entry->type != ere->re->type) + continue; + + /* + * If we have an entry that is changed but un + * processed and not a self route, then + * we should just drop this new self route + */ + if (CHECK_FLAG(entry->status, ROUTE_ENTRY_CHANGED) && + !(entry->flags & ZEBRA_FLAG_SELFROUTE)) { + early_route_memory_free(ere); + return; + } + } } /* Set default distance by route type. */ @@ -3746,10 +3767,8 @@ static struct meta_queue *meta_queue_new(void) new = XCALLOC(MTYPE_WORK_QUEUE, sizeof(struct meta_queue)); - for (i = 0; i < MQ_SIZE; i++) { + for (i = 0; i < MQ_SIZE; i++) new->subq[i] = list_new(); - assert(new->subq[i]); - } return new; } @@ -3935,12 +3954,7 @@ void meta_queue_free(struct meta_queue *mq, struct zebra_vrf *zvrf) /* initialise zebra rib work queue */ static void rib_queue_init(void) { - if (!(zrouter.ribq = work_queue_new(zrouter.master, - "route_node processing"))) { - flog_err(EC_ZEBRA_WQ_NONEXISTENT, - "%s: could not initialise work queue!", __func__); - return; - } + zrouter.ribq = work_queue_new(zrouter.master, "route_node processing"); /* fill in the work queue spec */ zrouter.ribq->spec.workfunc = &meta_queue_process; @@ -3950,11 +3964,8 @@ static void rib_queue_init(void) zrouter.ribq->spec.hold = ZEBRA_RIB_PROCESS_HOLD_TIME; zrouter.ribq->spec.retry = ZEBRA_RIB_PROCESS_RETRY_TIME; - if (!(zrouter.mq = meta_queue_new())) { - flog_err(EC_ZEBRA_WQ_NONEXISTENT, - "%s: could not initialise meta queue!", __func__); - return; - } + zrouter.mq = meta_queue_new(); + return; } |
