]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/fabricd.c
Merge pull request #5625 from qlyoung/fix-zapi-ipset-name-nullterm
[mirror_frr.git] / isisd / fabricd.c
index 302b7e17e32693aacef510abf228f34dccfabc78..b9c27d51bd89d0dc6aeac9fe32b98844cc500f0b 100644 (file)
@@ -81,7 +81,8 @@ struct neighbor_entry {
 static struct neighbor_entry *neighbor_entry_new(const uint8_t *id,
                                                 struct isis_adjacency *adj)
 {
-       struct neighbor_entry *rv = XMALLOC(MTYPE_FABRICD_NEIGHBOR, sizeof(*rv));
+       struct neighbor_entry *rv = XMALLOC(MTYPE_FABRICD_NEIGHBOR,
+                                           sizeof(*rv));
 
        memcpy(rv->id, id, sizeof(rv->id));
        rv->adj = adj;
@@ -107,9 +108,9 @@ static void neighbor_lists_clear(struct fabricd *f)
        hash_clean(f->neighbors_neighbors, neighbor_entry_del_void);
 }
 
-static unsigned neighbor_entry_hash_key(void *np)
+static unsigned neighbor_entry_hash_key(const void *np)
 {
-       struct neighbor_entry *n = np;
+       const struct neighbor_entry *n = np;
 
        return jhash(n->id, sizeof(n->id), 0x55aa5a5a);
 }
@@ -131,7 +132,7 @@ static int neighbor_entry_list_cmp(void *a, void *b)
 static struct neighbor_entry *neighbor_entry_lookup_list(struct skiplist *list,
                                                         const uint8_t *id)
 {
-       struct neighbor_entry n = {{0}};
+       struct neighbor_entry n = { {0} };
 
        memcpy(n.id, id, sizeof(n.id));
 
@@ -551,24 +552,25 @@ static void move_to_queue(struct isis_lsp *lsp, struct neighbor_entry *n,
        if (n->adj)
                isis_tx_queue_add(n->adj->circuit->tx_queue, lsp, type);
 
-       uint8_t *neighbor_id = XMALLOC(MTYPE_FABRICD_FLOODING_INFO, sizeof(n->id));
+       uint8_t *neighbor_id = XMALLOC(MTYPE_FABRICD_FLOODING_INFO,
+                                      sizeof(n->id));
 
        memcpy(neighbor_id, n->id, sizeof(n->id));
        listnode_add(lsp->flooding_neighbors[type], neighbor_id);
 }
 
-static void mark_neighbor_as_present(struct hash_backet *backet, void *arg)
+static void mark_neighbor_as_present(struct hash_bucket *bucket, void *arg)
 {
-       struct neighbor_entry *n = backet->data;
+       struct neighbor_entry *n = bucket->data;
 
        n->present = true;
 }
 
-static void handle_firsthops(struct hash_backet *backet, void *arg)
+static void handle_firsthops(struct hash_bucket *bucket, void *arg)
 {
        struct isis_lsp *lsp = arg;
        struct fabricd *f = lsp->area->fabricd;
-       struct isis_vertex *vertex = backet->data;
+       struct isis_vertex *vertex = bucket->data;
 
        struct neighbor_entry *n;
 
@@ -624,7 +626,8 @@ static void fabricd_lsp_reset_flooding_info(struct isis_lsp *lsp,
                }
 
                lsp->flooding_neighbors[type] = list_new();
-               lsp->flooding_neighbors[type]->del = fabricd_free_lsp_flooding_info;
+               lsp->flooding_neighbors[type]->del =
+                       fabricd_free_lsp_flooding_info;
        }
 
        if (circuit) {
@@ -645,33 +648,17 @@ void fabricd_lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit)
        void *cursor = NULL;
        struct neighbor_entry *n;
 
-       /* Mark all elements in NL as present and move T0s into DNR */
-       while (!skiplist_next(f->neighbors, NULL, (void **)&n, &cursor)) {
+       /* Mark all elements in NL as present */
+       while (!skiplist_next(f->neighbors, NULL, (void **)&n, &cursor))
                n->present = true;
 
-               struct isis_lsp *node_lsp = lsp_for_neighbor(f, n);
-               if (!node_lsp
-                   || !node_lsp->tlvs
-                   || !node_lsp->tlvs->spine_leaf
-                   || !node_lsp->tlvs->spine_leaf->has_tier
-                   || node_lsp->tlvs->spine_leaf->tier != 0) {
-                       continue;
-               }
-
-               if (isis->debugs & DEBUG_FLOODING) {
-                       zlog_debug("Moving %s to DNR because it's T0",
-                                  rawlspid_print(node_lsp->hdr.lsp_id));
-               }
-
-               move_to_queue(lsp, n, TX_LSP_CIRCUIT_SCOPED, circuit);
-       }
-
        /* Mark all elements in NN as present */
        hash_iterate(f->neighbors_neighbors, mark_neighbor_as_present, NULL);
 
-       struct isis_vertex *originator = isis_find_vertex(&f->spftree->paths,
-                                                         lsp->hdr.lsp_id,
-                                                         VTYPE_NONPSEUDO_TE_IS);
+       struct isis_vertex *originator =
+               isis_find_vertex(&f->spftree->paths,
+                                lsp->hdr.lsp_id,
+                                VTYPE_NONPSEUDO_TE_IS);
 
        /* Remove all IS from NL and NN in the shortest path
         * to the IS that originated the LSP */