X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bgpd%2Fbgp_route.c;h=2c361bef4d5b2693f85bd1289914d44da0a86176;hb=2569910bb6e5c00ececc60ed15b182e14a88cb9d;hp=23002fb74ca842184fdb2a01ebbf788ba49b995d;hpb=f30f54a79b80078d702d9e50f057323e680217c3;p=mirror_frr.git diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 23002fb74..2c361bef4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2265,20 +2265,26 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn, /* Do we need to allocate or free labels? * Right now, since we only deal with per-prefix labels, it is not - * necessary to do this upon changes to best path except if the label - * index changes + * necessary to do this upon changes to best path. Exceptions: + * - label index has changed -> recalculate resulting label + * - path_info sub_type changed -> switch to/from implicit-null + * - no valid label (due to removed static label binding) -> get new one */ if (bgp->allocate_mpls_labels[afi][safi]) { if (new_select) { if (!old_select || bgp_label_index_differs(new_select, old_select) - || new_select->sub_type != old_select->sub_type) { + || new_select->sub_type != old_select->sub_type + || !bgp_is_valid_label(&rn->local_label)) { + /* Enforced penultimate hop popping: + * implicit-null for local routes, aggregate + * and redistributed routes + */ if (new_select->sub_type == BGP_ROUTE_STATIC - && new_select->attr->flag - & ATTR_FLAG_BIT( - BGP_ATTR_PREFIX_SID) - && new_select->attr->label_index - != BGP_INVALID_LABEL_INDEX) { + || new_select->sub_type + == BGP_ROUTE_AGGREGATE + || new_select->sub_type + == BGP_ROUTE_REDISTRIBUTE) { if (CHECK_FLAG( rn->flags, BGP_NODE_REGISTERED_FOR_LABEL))