summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2018-04-15 12:25:24 -0700
committerDon Slice <dslice@cumulusnetworks.com>2018-04-16 06:09:29 -0700
commite71c84ca311ea9df723be7a6cb5869d45b3bb4d6 (patch)
treeb08662cca8e23e4909e877c22f8bf92616c993b8
parentbf2c7ef2a68b2df772233aaff5d8f63fb345a6bc (diff)
zebra: resolve assert when adding ip import-table entry
Problem was due to in certain route replace circumstances, we would mark the old route_entry as removed to delete it but would leave the selected flag set. When the rn was pulled off the work queue for process, we would find both the new re and old re (being deleted) with the selected flag set and would assert. In this change, when we decide to delete the old re, we also mark it as no longer selected. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
-rw-r--r--zebra/redistribute.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 15e7d4437a..6a7a75f209 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -531,6 +531,7 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
re->tag, rmap_name);
if (ret != RMAP_MATCH) {
+ UNSET_FLAG(same->flags, ZEBRA_FLAG_SELECTED);
zebra_del_import_table_entry(rn, re);
return 0;
}
@@ -547,8 +548,10 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
break;
}
- if (same)
+ if (same) {
+ UNSET_FLAG(same->flags, ZEBRA_FLAG_SELECTED);
zebra_del_import_table_entry(rn, same);
+ }
newre = XCALLOC(MTYPE_RE, sizeof(struct route_entry));
newre->type = ZEBRA_ROUTE_TABLE;