summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Degtyarev <adeg47@gmail.com>2018-11-14 04:14:04 +0100
committerAnton Degtyarev <adeg47@gmail.com>2018-12-20 13:28:52 +0100
commit57592a53b5c02094f915a8444d40d2361d31e972 (patch)
tree4948c69d7951e9dc0008e110f9d7d489a8c3f742 /lib
parentMerge pull request #3448 from chiragshah6/evpn_dev1 (diff)
downloadfrr-57592a53b5c02094f915a8444d40d2361d31e972.tar.xz
frr-57592a53b5c02094f915a8444d40d2361d31e972.zip
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 'lib')
-rw-r--r--lib/zclient.h4
-rw-r--r--lib/zebra.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index adb48b252..8fe711f31 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -58,6 +58,10 @@
#define ZEBRA_IPTABLES_FORWARD 0
#define ZEBRA_IPTABLES_DROP 1
+/* Zebra FEC register command flags. */
+#define ZEBRA_FEC_REGISTER_LABEL 0x1
+#define ZEBRA_FEC_REGISTER_LABEL_INDEX 0x2
+
extern struct sockaddr_storage zclient_addr;
extern socklen_t zclient_addr_len;
diff --git a/lib/zebra.h b/lib/zebra.h
index 0f3f45f7b..09115951e 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -452,9 +452,6 @@ extern const char *zserv_command_string(unsigned int command);
*/
#define ZEBRA_FLAG_ONLINK 0x80
-/* Zebra FEC flags. */
-#define ZEBRA_FEC_REGISTER_LABEL_INDEX 0x1
-
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
#endif