summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {