summaryrefslogtreecommitdiff
path: root/bgpd/bgp_updgrp.c
diff options
context:
space:
mode:
authorAbhinay Ramesh <rabhinay@vmware.com>2022-03-07 08:56:10 +0000
committerARShreenidhi <rshreenidhi@vmware.com>2022-07-06 05:38:35 +0000
commita9ae9fb5bbe0b54938041b63bf5c75711eb5d14f (patch)
treeddf65fb74bc4dc10a051a6d6c5fc3f383d7a83b0 /bgpd/bgp_updgrp.c
parent46c4f05bb6bf7a3f708ce06cf400fe6a0c987366 (diff)
bgpd: fix route-map update and delete route-map
Description: - When there is change in route-map properties after setting the route-map with default route, changes will not reflect. - When route-map associated with default-originate is deleted, default route doesn't get withdrawn. - When there is change in route-map default-originate flow does not get triggered. Fix: - One of the flags needs to be unset for default-originate flow to get triggered after change in route-map. Have unset the flag, so that default originate flow can be triggered. Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
Diffstat (limited to 'bgpd/bgp_updgrp.c')
-rw-r--r--bgpd/bgp_updgrp.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index c2b6632643..af2f564de7 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -1482,7 +1482,24 @@ static int updgrp_policy_update_walkcb(struct update_group *updgrp, void *arg)
"u%" PRIu64 ":s%" PRIu64" announcing default upon default routemap %s change",
updgrp->id, subgrp->id,
ctx->policy_name);
- subgroup_default_originate(subgrp, 0);
+ if (route_map_lookup_by_name(ctx->policy_name)) {
+ /*
+ * When there is change in routemap, this flow
+ * is triggered. the routemap is still present
+ * in lib, hence its a update flow. The flag
+ * needs to be unset.
+ */
+ UNSET_FLAG(subgrp->sflags,
+ SUBGRP_STATUS_DEFAULT_ORIGINATE);
+ subgroup_default_originate(subgrp, 0);
+ } else {
+ /*
+ * This is a explicit withdraw, since the
+ * routemap is not present in routemap lib. need
+ * to pass 1 for withdraw arg.
+ */
+ subgroup_default_originate(subgrp, 1);
+ }
}
update_subgroup_set_needs_refresh(subgrp, 0);
}
@@ -1860,6 +1877,13 @@ update_group_default_originate_route_map_walkcb(struct update_group *updgrp,
safi = SUBGRP_SAFI(subgrp);
if (peer->default_rmap[afi][safi].name) {
+ /*
+ * When there is change in routemap this flow will
+ * be triggered. We need to unset the Flag to ensure
+ * the update flow gets triggered.
+ */
+ UNSET_FLAG(subgrp->sflags,
+ SUBGRP_STATUS_DEFAULT_ORIGINATE);
subgroup_default_originate(subgrp, 0);
}
}