From: Don Slice Date: Sun, 15 Apr 2018 19:25:24 +0000 (-0700) Subject: zebra: resolve assert when adding ip import-table entry X-Git-Tag: frr-5.0-dev~46^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e71c84ca311ea9df723be7a6cb5869d45b3bb4d6;p=matthieu%2Ffrr.git 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 --- 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;