bgpd: labeled-unicast issue changing from no import-check to using import-check

Problem seen in testing import-check using labeled-unicast address-family. When
transitioning from "no bgp network import-check" to "bgp network import-check",
previously installed networks were not removed.  This fix resolves this.

Ticket: CM-16512
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
This commit is contained in:
Don Slice 2017-05-26 17:05:18 +00:00
parent cf4e348abb
commit 4dfee0ce4e

View File

@ -3901,10 +3901,9 @@ bgp_static_update (struct bgp *bgp, struct prefix *p,
/* Nexthop reachability check. */ /* Nexthop reachability check. */
if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK) && if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK) &&
safi == SAFI_UNICAST) (safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST))
{ {
if (bgp_find_or_add_nexthop (bgp, afi, ri, NULL, 0) && if (bgp_find_or_add_nexthop (bgp, afi, ri, NULL, 0))
safi == SAFI_UNICAST)
bgp_info_set_flag (rn, ri, BGP_INFO_VALID); bgp_info_set_flag (rn, ri, BGP_INFO_VALID);
else else
{ {
@ -3942,7 +3941,8 @@ bgp_static_update (struct bgp *bgp, struct prefix *p,
new = info_make(ZEBRA_ROUTE_BGP, BGP_ROUTE_STATIC, 0, bgp->peer_self, attr_new, new = info_make(ZEBRA_ROUTE_BGP, BGP_ROUTE_STATIC, 0, bgp->peer_self, attr_new,
rn); rn);
/* Nexthop reachability check. */ /* Nexthop reachability check. */
if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK)) if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK) &&
(safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST))
{ {
if (bgp_find_or_add_nexthop (bgp, afi, new, NULL, 0)) if (bgp_find_or_add_nexthop (bgp, afi, new, NULL, 0))
bgp_info_set_flag (rn, new, BGP_INFO_VALID); bgp_info_set_flag (rn, new, BGP_INFO_VALID);