#include "isisd/isis_csm.h"
#include "isisd/isis_adjacency.h"
#include "isisd/isis_spf.h"
-#include "isisd/isis_te.h"
#include "isisd/isis_mt.h"
#include "isisd/isis_tlvs.h"
+#include "isisd/isis_te.h"
#include "isisd/fabricd.h"
#include "isisd/isis_tx_queue.h"
+#include "isisd/isis_nb.h"
static int lsp_refresh(struct thread *thread);
static int lsp_l1_refresh_pseudo(struct thread *thread);
if (!rn->info)
continue;
struct isis_ext_info *info = rn->info;
-
struct prefix_ipv6 *p, *src_p;
+
srcdest_rnode_prefixes(rn, (const struct prefix **)&p,
(const struct prefix **)&src_p);
/* Protocols Supported */
if (area->ip_circuits > 0 || area->ipv6_circuits > 0) {
struct nlpids nlpids = {.count = 0};
+
if (area->ip_circuits > 0) {
lsp_debug(
"ISIS (%s): Found IPv4 circuit, adding IPv4 to NLPIDs",
area->area_tag);
}
- /* IPv4 address and TE router ID TLVs. In case of the first one we don't
- * follow "C" vendor, but "J" vendor behavior - one IPv4 address is put
- * into
- * LSP and this address is same as router id. */
+ /* IPv4 address and TE router ID TLVs.
+ * In case of the first one we don't follow "C" vendor,
+ * but "J" vendor behavior - one IPv4 address is put
+ * into LSP. TE router ID will be the same if MPLS-TE
+ * is not activate or MPLS-TE router-id not specified
+ */
if (isis->router_id != 0) {
struct in_addr id = {.s_addr = isis->router_id};
inet_ntop(AF_INET, &id, buf, sizeof(buf));
area->area_tag, buf);
isis_tlvs_add_ipv4_address(lsp->tlvs, &id);
- /* Exactly same data is put into TE router ID TLV, but only if
- * new style
- * TLV's are in use. */
+ /* If new style TLV's are in use, add TE router ID TLV
+ * Check if MPLS-TE is activate and mpls-te router-id set
+ * otherwise add exactly same data as for IPv4 address
+ */
if (area->newmetric) {
-
+ if (IS_MPLS_TE(area->mta)
+ && area->mta->router_id.s_addr != 0)
+ id.s_addr = area->mta->router_id.s_addr;
lsp_debug(
"ISIS (%s): Adding router ID also as TE router ID tlv.",
area->area_tag);
&& circuit->ipv6_non_link->count > 0) {
struct listnode *ipnode;
struct prefix_ipv6 *ipv6;
+
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link,
ipnode, ipv6)) {
lsp_debug(
lsp->tlvs, ne_id,
metric);
}
- if (area->newmetric) {
- uint8_t subtlvs[256];
- uint8_t subtlv_len;
-
- if (IS_MPLS_TE(area->mta)
- && circuit->interface
- && HAS_LINK_PARAMS(
- circuit->interface))
- subtlv_len = add_te_subtlvs(
- subtlvs,
- circuit->mtc);
- else
- subtlv_len = 0;
-
+ if (area->newmetric)
tlvs_add_mt_bcast(
lsp->tlvs, circuit,
- level, ne_id, metric,
- subtlvs, subtlv_len);
- }
+ level, ne_id, metric);
}
} else {
lsp_debug(
lsp->tlvs, ne_id, metric);
}
if (area->newmetric) {
- uint8_t subtlvs[256];
- uint8_t subtlv_len;
-
- if (IS_MPLS_TE(area->mta)
- && circuit->interface != NULL
- && HAS_LINK_PARAMS(
- circuit->interface))
- /* Update Local and Remote IP
- * address for MPLS TE circuit
- * parameters */
- /* NOTE sure that it is the
- * pertinent place for that
- * updates */
- /* Local IP address could be
- * updated in isis_circuit.c -
- * isis_circuit_add_addr() */
- /* But, where update remote IP
- * address ? in isis_pdu.c -
- * process_p2p_hello() ? */
-
- /* Add SubTLVs & Adjust real
- * size of SubTLVs */
- subtlv_len = add_te_subtlvs(
- subtlvs, circuit->mtc);
- else
- /* Or keep only TE metric with
- * no SubTLVs if MPLS_TE is off
- */
- subtlv_len = 0;
-
uint32_t neighbor_metric;
if (fabricd_tier(area) == 0) {
neighbor_metric = 0xffe;
}
tlvs_add_mt_p2p(lsp->tlvs, circuit,
- ne_id, neighbor_metric,
- subtlvs, subtlv_len);
+ ne_id, neighbor_metric);
}
} else {
lsp_debug(
}
if (circuit->area->newmetric) {
isis_tlvs_add_extended_reach(lsp->tlvs, ISIS_MT_IPV4_UNICAST,
- ne_id, 0, NULL, 0);
+ ne_id, 0, circuit->ext);
lsp_debug(
"ISIS (%s): Adding %s.%02x as te-style neighbor (self)",
area->area_tag, sysid_print(ne_id),
if (circuit->area->newmetric) {
isis_tlvs_add_extended_reach(lsp->tlvs,
ISIS_MT_IPV4_UNICAST,
- ne_id, 0, NULL, 0);
+ ne_id, 0, circuit->ext);
lsp_debug(
"ISIS (%s): Adding %s.%02x as te-style neighbor (peer)",
area->area_tag, sysid_print(ne_id),