]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_lsp.c
isisd: Add support for RFC6119 (IPv6 TE in IS-IS)
[mirror_frr.git] / isisd / isis_lsp.c
index 5c013d634b72ea68fe37f4aa90d6648cd52bc7a7..94353a5bc893df42fee679f729fc1032cf99ae30 100644 (file)
@@ -641,7 +641,7 @@ void lsp_insert(struct lspdb_head *head, struct isis_lsp *lsp)
 }
 
 /*
- * Build a list of LSPs with non-zero ht bounded by start and stop ids
+ * Build a list of LSPs with non-zero ht and seqno bounded by start and stop ids
  */
 void lsp_build_list_nonzero_ht(struct lspdb_head *head, const uint8_t *start_id,
                               const uint8_t *stop_id, struct list *list)
@@ -657,7 +657,7 @@ void lsp_build_list_nonzero_ht(struct lspdb_head *head, const uint8_t *start_id,
                           ISIS_SYS_ID_LEN + 2) > 0)
                        break;
 
-               if (lsp->hdr.rem_lifetime)
+               if (lsp->hdr.rem_lifetime && lsp->hdr.seqno)
                        listnode_add(list, lsp);
        }
 }
@@ -1067,6 +1067,14 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
                          area->area_tag);
        }
 
+       if (IS_MPLS_TE(area->mta)
+           && !IN6_IS_ADDR_UNSPECIFIED(&area->mta->router_id_ipv6)) {
+               lsp_debug("ISIS (%s): Adding IPv6 TE Router ID tlv.",
+                         area->area_tag);
+               isis_tlvs_set_te_router_id_ipv6(lsp->tlvs,
+                                               &area->mta->router_id_ipv6);
+       }
+
        lsp_debug("ISIS (%s): Adding circuit specific information.",
                  area->area_tag);
 
@@ -1601,6 +1609,7 @@ static void lsp_build_pseudo(struct isis_lsp *lsp, struct isis_circuit *circuit,
        struct list *adj_list;
        struct listnode *node;
        struct isis_area *area = circuit->area;
+       uint16_t mtid;
 
        lsp_clear_data(lsp);
        lsp->tlvs = isis_alloc_tlvs();
@@ -1630,8 +1639,11 @@ static void lsp_build_pseudo(struct isis_lsp *lsp, struct isis_circuit *circuit,
                        LSP_PSEUDO_ID(ne_id));
        }
        if (circuit->area->newmetric) {
-               isis_tlvs_add_extended_reach(lsp->tlvs, ISIS_MT_IPV4_UNICAST,
-                                            ne_id, 0, NULL);
+               if (area_is_mt(circuit->area))
+                       mtid = ISIS_MT_IPV4_UNICAST;
+               else
+                       mtid = ISIS_MT_DISABLE;
+               isis_tlvs_add_extended_reach(lsp->tlvs, mtid, ne_id, 0, NULL);
                lsp_debug(
                        "ISIS (%s): Adding %s.%02x as te-style neighbor (self)",
                        area->area_tag, sysid_print(ne_id),