]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: Don't corrupt generated LSPs if information exceeds capacity 1226/head
authorChristian Franke <chris@opensourcerouting.org>
Fri, 22 Sep 2017 20:17:20 +0000 (22:17 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Fri, 22 Sep 2017 20:17:20 +0000 (22:17 +0200)
Standard IS-IS only supports up to 256 fragments per router. Recognize
when the information we want to advertise exceeds 256 fragments and
print a warning in this case instead of overflowing the fragment counter
and overwriting existing LSP fragments.

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

index 2e1e8e5fc367d6359ff784a1382d6d4aa29d05ab..8e916d8fe03a7c059847e5220dd082a7549e8d06 100644 (file)
@@ -1120,9 +1120,20 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
        }
        isis_free_tlvs(tlvs);
 
+       bool fragment_overflow = false;
        frag = lsp;
        for (ALL_LIST_ELEMENTS_RO(fragments, node, tlvs)) {
                if (node != listhead(fragments)) {
+                       if (LSP_FRAGMENT(frag->hdr.lsp_id) == 255) {
+                               if (!fragment_overflow) {
+                                       fragment_overflow = true;
+                                       zlog_warn("ISIS (%s): Too much information for 256 fragments",
+                                                 area->area_tag);
+                               }
+                               isis_free_tlvs(tlvs);
+                               continue;
+                       }
+
                        frag = lsp_next_frag(LSP_FRAGMENT(frag->hdr.lsp_id) + 1,
                                             lsp, area, level);
                }