From 1844fdbd7f3ad9e2a56652331f3833a7c44e69c4 Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 28 Sep 2015 12:27:17 -0700 Subject: [PATCH] BGP: Fix source route type in redistributed route Ticket: CM-7593 Reviewed By: CCR-3563 Testing Done: Manual verification of failed scenario (2.5-br) When BGP receives an update to a redistributed route and the type of the source has changed (e.g., from OSPF to static), the source route type is not being updated in the RIB entry. This can lead to problems such as the route being incorrectly deleted if redistribution for the prior source is unconfigured. Fix the code to update the source route type. Signed-off-by: Vivek Venkatraman Reviewed-by: Donald Sharp Reviewed-by: Vipin Kumar --- bgpd/bgp_route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index efcaf23150..b569aef6d9 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6362,6 +6362,8 @@ bgp_redistribute_add (struct prefix *p, const struct in_addr *nexthop, if (bi) { + /* Ensure the (source route) type is updated. */ + bi->type = type; if (attrhash_cmp (bi->attr, new_attr) && !CHECK_FLAG(bi->flags, BGP_INFO_REMOVED)) { -- 2.39.5