summaryrefslogtreecommitdiff
path: root/bgpd/bgp_table.h
diff options
context:
space:
mode:
authorPat Ruddy <pat@voltanet.io>2020-12-17 10:41:07 +0000
committerPat Ruddy <pat@voltanet.io>2021-01-04 14:29:44 +0000
commit992dd67ec76de375b967b408c26f9c9f9e0608c5 (patch)
treebeb593cd4aea8b15d6fbbab0cf0fcd76ca20ee09 /bgpd/bgp_table.h
parent189982283ad88132fbdb1342895c7404fa5fc34a (diff)
bgpd: refactor label allocation code
To prepare for fixing an issue where labels do not get released back to the labelpool when the route is deleted some refactoring is necessary. There are 2 parts to this. 1. restructure the code to remove the circular nature of label allocations via the labelpool and decouple the label type decision from the notification fo the FEC. The code to notify the FEC association to zebra has been split out into a separate function so that it can be called from the synchronous path (for registration of index-based labels and de-registration of all labels), and from the asynchronous path where we need to wait for a callback from the labelpool code with a label allocation. The decision about whether we are using an index-based label or an allocated label is reflected in the state of the BGP_NODE_LABEL_REQUESTED flag so the checks on the path_info in the labelpool callback code are no longer required. 2. change the owned of a labelpool allocated label from the path info structure to the bgp_dest structure. This allows labels to be released (in a subsequent commit) when the owner (bgp_dest) goes away. Signed-off-by: Pat Ruddy <pat@voltanet.io>
Diffstat (limited to 'bgpd/bgp_table.h')
-rw-r--r--bgpd/bgp_table.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h
index 738d41ee6d..68b460149c 100644
--- a/bgpd/bgp_table.h
+++ b/bgpd/bgp_table.h
@@ -104,6 +104,7 @@ struct bgp_node {
#define BGP_NODE_SELECT_DEFER (1 << 4)
#define BGP_NODE_FIB_INSTALL_PENDING (1 << 5)
#define BGP_NODE_FIB_INSTALLED (1 << 6)
+#define BGP_NODE_LABEL_REQUESTED (1 << 7)
struct bgp_addpath_node_data tx_addpath;