diff options
Diffstat (limited to 'bgpd/bgp_updgrp.c')
| -rw-r--r-- | bgpd/bgp_updgrp.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index adde379fb0..ea8d2330c5 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -1479,7 +1479,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); } @@ -1857,6 +1874,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); } } |
