diff options
| author | Anton Degtyarev <adeg47@gmail.com> | 2018-11-14 06:14:04 +0300 | 
|---|---|---|
| committer | Anton Degtyarev <adeg47@gmail.com> | 2018-12-20 15:28:52 +0300 | 
| commit | 57592a53b5c02094f915a8444d40d2361d31e972 (patch) | |
| tree | 4948c69d7951e9dc0008e110f9d7d489a8c3f742 /zebra/zebra_mpls.h | |
| parent | f944fe9b004be9c6076f2fed3004a85fc284cad1 (diff) | |
bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP labeled unicast
This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made:
* bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes.
* bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed)
* bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index
* zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC.
Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mpls.h')
| -rw-r--r-- | zebra/zebra_mpls.h | 11 | 
1 files changed, 2 insertions, 9 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 86bee129cf..c250fc4058 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -191,16 +191,9 @@ int zebra_mpls_lsp_install(struct zebra_vrf *zvrf, struct route_node *rn,  int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn,  			     struct route_entry *re); -/* - * Registration from a client for the label binding for a FEC. If a binding - * already exists, it is informed to the client. - * NOTE: If there is a manually configured label binding, that is used. - * Otherwise, if aa label index is specified, it means we have to allocate the - * label from a locally configured label block (SRGB), if one exists and index - * is acceptable. - */  int zebra_mpls_fec_register(struct zebra_vrf *zvrf, struct prefix *p, -			    uint32_t label_index, struct zserv *client); +			    uint32_t label, uint32_t label_index, +			    struct zserv *client);  /*   * Deregistration from a client for the label binding for a FEC. The FEC  | 
