]> git.puffer.fish Git - mirror/frr.git/commitdiff
fabricd: Fix flooding bug
authorChristian Franke <chris@opensourcerouting.org>
Thu, 15 Nov 2018 12:05:35 +0000 (13:05 +0100)
committerChristian Franke <chris@opensourcerouting.org>
Thu, 15 Nov 2018 14:06:40 +0000 (15:06 +0100)
Due to `lsp` getting shadowed, we would send each T0 its own LSP
whenever we actually wanted to flood a different LSP.

Fix this and set -Wshadow=local in my build environment. m(

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/fabricd.c

index 76c8087f2d8331b14bfffee89a2552cd88adadaa..2b3116b1ff19fd107d4f69c31b7cf1db1903f7a4 100644 (file)
@@ -585,17 +585,19 @@ void fabricd_lsp_flood(struct isis_lsp *lsp)
        while (!skiplist_next(f->neighbors, NULL, (void **)&n, &cursor)) {
                n->present = true;
 
-               struct isis_lsp *lsp = lsp_for_vertex(f->spftree, n->vertex);
-               if (!lsp || !lsp->tlvs || !lsp->tlvs->spine_leaf)
-                       continue;
-
-               if (!lsp->tlvs->spine_leaf->has_tier
-                   || lsp->tlvs->spine_leaf->tier != 0)
+               struct isis_lsp *node_lsp = lsp_for_vertex(f->spftree,
+                                                          n->vertex);
+               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_FABRICD_FLOODING) {
                        zlog_debug("Moving %s to DNR because it's T0",
-                                  rawlspid_print(lsp->hdr.lsp_id));
+                                  rawlspid_print(node_lsp->hdr.lsp_id));
                }
 
                move_to_dnr(lsp, n);