From: Don Slice Date: Fri, 26 May 2017 17:05:18 +0000 (+0000) Subject: bgpd: labeled-unicast issue changing from no import-check to using import-check X-Git-Tag: reindent-master-before~113^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F623%2Fhead;p=mirror%2Ffrr.git 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 --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 7a328e79d7..41ce7fb6d0 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -3901,10 +3901,9 @@ bgp_static_update (struct bgp *bgp, struct prefix *p, /* Nexthop reachability 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) && - safi == SAFI_UNICAST) + if (bgp_find_or_add_nexthop (bgp, afi, ri, NULL, 0)) bgp_info_set_flag (rn, ri, BGP_INFO_VALID); 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, rn); /* 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)) bgp_info_set_flag (rn, new, BGP_INFO_VALID);