summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-05-27 10:14:09 +0300
committerGitHub <noreply@github.com>2021-05-27 10:14:09 +0300
commitaedcc7778dfbfb9e56eb33c93b42c93a65598296 (patch)
tree6c38f05a7e7bce510cfa3cc82c8228a0e945629d
parent6a4f3bb66bd23c2b795fe3cf62f52c32d5471b21 (diff)
parentd27d5e0e535e62485dd42c2719e39bb83a29205a (diff)
Merge pull request #8743 from taspelund/fix_pfx-tree_default_8.0
[8.0] lib: fix handling of rmap prefix-tree default node
-rw-r--r--lib/routemap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index b2cb299fd3..9dc1c7c82d 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1982,7 +1982,15 @@ static void route_map_add_plist_entries(afi_t afi,
return;
}
- route_map_pfx_table_del_default(afi, index);
+ /* Default entry should be deleted only if the first entry of the
+ * prefix-list is created.
+ */
+ if (entry) {
+ if (plist->count == 1)
+ route_map_pfx_table_del_default(afi, index);
+ } else {
+ route_map_pfx_table_del_default(afi, index);
+ }
if (entry) {
if (afi == AFI_IP) {