#include "zebra/zebra_router.h"
#include "zebra/redistribute.h"
#include "zebra/debug.h"
-#include "zebra/zebra_memory.h"
#include "zebra/zebra_vrf.h"
#include "zebra/zebra_mpls.h"
#include "zebra/zebra_srte.h"
zebra_lsp_t *lsp;
lsp = (zebra_lsp_t *)bucket->data;
+
+ /* In the common flow, this is used when external events occur. For
+ * LSPs with backup nhlfes, we'll assume that the forwarding
+ * plane will use the backups to handle these events, until the
+ * owning protocol can react.
+ */
+ if (ctxt == NULL) {
+ /* Skip LSPs with backups */
+ if (nhlfe_list_first(&lsp->backup_nhlfe_list) != NULL) {
+ if (IS_ZEBRA_DEBUG_MPLS_DETAIL)
+ zlog_debug("%s: skip LSP in-label %u",
+ __func__, lsp->ile.in_label);
+ return;
+ }
+ }
+
(void)lsp_processq_add(lsp);
}
int start_count = 0, end_count = 0; /* Installed counts */
bool changed_p = false;
bool is_debug = (IS_ZEBRA_DEBUG_DPLANE | IS_ZEBRA_DEBUG_MPLS);
+ enum zebra_sr_policy_update_label_mode update_mode;
if (is_debug)
zlog_debug("LSP dplane notif, in-label %u",
if (end_count > 0) {
SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+ /* SR-TE update too */
+ if (start_count == 0)
+ update_mode = ZEBRA_SR_POLICY_LABEL_CREATED;
+ else
+ update_mode = ZEBRA_SR_POLICY_LABEL_UPDATED;
+ zebra_sr_policy_label_update(lsp->ile.in_label, update_mode);
+
if (changed_p)
dplane_lsp_notif_update(lsp, DPLANE_OP_LSP_UPDATE, ctx);
} else {
+ /* SR-TE update too */
+ zebra_sr_policy_label_update(lsp->ile.in_label,
+ ZEBRA_SR_POLICY_LABEL_REMOVED);
+
UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
clear_nhlfe_installed(lsp);
}
*/
void zebra_mpls_init_tables(struct zebra_vrf *zvrf)
{
+ char buffer[80];
+
if (!zvrf)
return;
- zvrf->slsp_table =
- hash_create(label_hash, label_cmp, "ZEBRA SLSP table");
- zvrf->lsp_table = hash_create(label_hash, label_cmp, "ZEBRA LSP table");
+
+ snprintf(buffer, sizeof(buffer), "ZEBRA SLSP table: %s",
+ zvrf->vrf->name);
+ zvrf->slsp_table = hash_create_size(8, label_hash, label_cmp, buffer);
+
+ snprintf(buffer, sizeof(buffer), "ZEBRA LSP table: %s",
+ zvrf->vrf->name);
+ zvrf->lsp_table = hash_create_size(8, label_hash, label_cmp, buffer);
zvrf->fec_table[AFI_IP] = route_table_init();
zvrf->fec_table[AFI_IP6] = route_table_init();
zvrf->mpls_flags = 0;