]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_spf.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / isisd / isis_spf.c
index 25e2d43cea760e8e1c5cece2192096688ae8bd8e..b6f751463a7ce187478f50f557ba319a456c0213 100644 (file)
@@ -179,14 +179,14 @@ const char *vid2string(struct isis_vertex *vertex, char *buff, int size)
 }
 
 static struct isis_vertex *isis_vertex_new(struct isis_spftree *spftree,
-                                          union isis_N *n,
+                                          void *id,
                                           enum vertextype vtype)
 {
        struct isis_vertex *vertex;
 
        vertex = XCALLOC(MTYPE_ISIS_VERTEX, sizeof(struct isis_vertex));
 
-       isis_vertex_id_init(vertex, n, vtype);
+       isis_vertex_id_init(vertex, id, vtype);
 
        vertex->Adj_N = list_new();
        vertex->parents = list_new();
@@ -330,17 +330,13 @@ static struct isis_vertex *isis_spf_add_root(struct isis_spftree *spftree,
 #ifdef EXTREME_DEBUG
        char buff[VID2STR_BUFFER];
 #endif /* EXTREME_DEBUG */
-       union isis_N n;
-
-       memcpy(n.id, sysid, ISIS_SYS_ID_LEN);
-       LSP_PSEUDO_ID(n.id) = 0;
 
        lsp = isis_root_system_lsp(spftree->area, spftree->level, sysid);
        if (lsp == NULL)
                zlog_warn("ISIS-Spf: could not find own l%d LSP!",
                          spftree->level);
 
-       vertex = isis_vertex_new(spftree, &n,
+       vertex = isis_vertex_new(spftree, sysid,
                                 spftree->area->oldmetric
                                         ? VTYPE_NONPSEUDO_IS
                                         : VTYPE_NONPSEUDO_TE_IS);
@@ -607,6 +603,9 @@ lspfragloop:
                        for (r = (struct isis_oldstyle_reach *)
                                         lsp->tlvs->oldstyle_reach.head;
                             r; r = r->next) {
+                               if (fabricd)
+                                       continue;
+
                                /* C.2.6 a) */
                                /* Two way connectivity */
                                if (!memcmp(r->id, root_sysid, ISIS_SYS_ID_LEN))
@@ -651,7 +650,7 @@ lspfragloop:
                }
        }
 
-       if (!pseudo_lsp && spftree->family == AF_INET
+       if (!fabricd && !pseudo_lsp && spftree->family == AF_INET
            && spftree->mtid == ISIS_MT_IPV4_UNICAST) {
                struct isis_item_list *reachs[] = {
                        &lsp->tlvs->oldstyle_ip_reach,
@@ -825,7 +824,7 @@ static int isis_spf_preload_tent(struct isis_spftree *spftree,
                        adjdb = circuit->u.bc.adjdb[spftree->level - 1];
                        isis_adj_build_up_list(adjdb, adj_list);
                        if (listcount(adj_list) == 0) {
-                               list_delete_and_null(&adj_list);
+                               list_delete(&adj_list);
                                if (isis->debugs & DEBUG_SPF_EVENTS)
                                        zlog_debug(
                                                "ISIS-Spf: no L%d adjacencies on circuit %s",
@@ -888,10 +887,10 @@ static int isis_spf_preload_tent(struct isis_spftree *spftree,
                                case ISIS_SYSTYPE_UNKNOWN:
                                default:
                                        zlog_warn(
-                                               "isis_spf_preload_tent unknow adj type");
+                                               "isis_spf_preload_tent unknown adj type");
                                }
                        }
-                       list_delete_and_null(&adj_list);
+                       list_delete(&adj_list);
                        /*
                         * Add the pseudonode
                         */
@@ -1069,7 +1068,8 @@ static void isis_spf_loop(struct isis_spftree *spftree,
                lsp = lsp_for_vertex(spftree, vertex);
                if (!lsp) {
                        zlog_warn("ISIS-Spf: No LSP found for %s",
-                                 rawlspid_print(vertex->N.id)); /* FIXME */
+                                 isis_format_id(vertex->N.id,
+                                                sizeof(vertex->N.id)));
                        continue;
                }
 
@@ -1248,7 +1248,8 @@ static struct isis_spf_run *isis_run_spf_arg(struct isis_area *area, int level)
        return run;
 }
 
-int isis_spf_schedule(struct isis_area *area, int level)
+int _isis_spf_schedule(struct isis_area *area, int level,
+                      const char *func, const char *file, int line)
 {
        struct isis_spftree *spftree = area->spftree[SPFTREE_IPV4][level - 1];
        time_t now = monotime(NULL);
@@ -1257,10 +1258,12 @@ int isis_spf_schedule(struct isis_area *area, int level)
        assert(diff >= 0);
        assert(area->is_type & level);
 
-       if (isis->debugs & DEBUG_SPF_EVENTS)
+       if (isis->debugs & DEBUG_SPF_EVENTS) {
                zlog_debug(
-                       "ISIS-Spf (%s) L%d SPF schedule called, lastrun %d sec ago",
-                       area->area_tag, level, diff);
+                       "ISIS-Spf (%s) L%d SPF schedule called, lastrun %d sec ago"
+                       " Caller: %s %s:%d",
+                       area->area_tag, level, diff, func, file, line);
+       }
 
        if (area->spf_delay_ietf[level - 1]) {
                /* Need to call schedule function also if spf delay is running