diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-09-22 17:24:16 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-09-22 17:24:16 +0200 |
commit | 71fb99d22ebe05b18aa01ab02eed957dd1167a97 (patch) | |
tree | fa0379be55a06538e3072c7097e9488ec64fbaac | |
parent | Merge pull request #14450 from kuldeepkash/general_fixes (diff) | |
download | frr-71fb99d22ebe05b18aa01ab02eed957dd1167a97.tar.xz frr-71fb99d22ebe05b18aa01ab02eed957dd1167a97.zip |
Revert "lib : fix duplicate prefix list delete"
This reverts commit 394ed767e7207805a6d916b01b1f1d4743c03dd1.
-rw-r--r-- | lib/plist.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/lib/plist.c b/lib/plist.c index d8ce83d21..e286a32f9 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -336,22 +336,6 @@ prefix_list_entry_lookup(struct prefix_list *plist, struct prefix *prefix, return NULL; } -static bool -prefix_list_entry_lookup_prefix(struct prefix_list *plist, - struct prefix_list_entry *plist_entry) -{ - struct prefix_list_entry *pentry = NULL; - - for (pentry = plist->head; pentry; pentry = pentry->next) { - if (pentry == plist_entry) - continue; - if (prefix_same(&pentry->prefix, &plist_entry->prefix)) - return true; - } - - return false; -} - static void trie_walk_affected(size_t validbits, struct pltrie_table *table, uint8_t byte, struct prefix_list_entry *object, void (*fn)(struct prefix_list_entry *object, @@ -420,16 +404,12 @@ static void prefix_list_trie_del(struct prefix_list *plist, void prefix_list_entry_delete(struct prefix_list *plist, - struct prefix_list_entry *pentry, int update_list) + struct prefix_list_entry *pentry, + int update_list) { - bool duplicate = false; - if (plist == NULL || pentry == NULL) return; - if (prefix_list_entry_lookup_prefix(plist, pentry)) - duplicate = true; - prefix_list_trie_del(plist, pentry); if (pentry->prev) @@ -441,10 +421,8 @@ void prefix_list_entry_delete(struct prefix_list *plist, else plist->tail = pentry->prev; - if (!duplicate) - route_map_notify_pentry_dependencies(plist->name, pentry, - RMAP_EVENT_PLIST_DELETED); - + route_map_notify_pentry_dependencies(plist->name, pentry, + RMAP_EVENT_PLIST_DELETED); prefix_list_entry_free(pentry); plist->count--; @@ -579,15 +557,11 @@ static void prefix_list_entry_add(struct prefix_list *plist, void prefix_list_entry_update_start(struct prefix_list_entry *ple) { struct prefix_list *pl = ple->pl; - bool duplicate = false; /* Not installed, nothing to do. */ if (!ple->installed) return; - if (prefix_list_entry_lookup_prefix(pl, ple)) - duplicate = true; - prefix_list_trie_del(pl, ple); /* List manipulation: shameless copy from `prefix_list_entry_delete`. */ @@ -600,9 +574,8 @@ void prefix_list_entry_update_start(struct prefix_list_entry *ple) else pl->tail = ple->prev; - if (!duplicate) - route_map_notify_pentry_dependencies(pl->name, ple, - RMAP_EVENT_PLIST_DELETED); + route_map_notify_pentry_dependencies(pl->name, ple, + RMAP_EVENT_PLIST_DELETED); pl->count--; route_map_notify_dependencies(pl->name, RMAP_EVENT_PLIST_DELETED); |