mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 08:32:45 +00:00
isisd: Don't corrupt generated LSPs if information exceeds capacity
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>
This commit is contained in:
parent
b1cebe20cd
commit
789c4dfc0b
@ -1120,9 +1120,20 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
|
|||||||
}
|
}
|
||||||
isis_free_tlvs(tlvs);
|
isis_free_tlvs(tlvs);
|
||||||
|
|
||||||
|
bool fragment_overflow = false;
|
||||||
frag = lsp;
|
frag = lsp;
|
||||||
for (ALL_LIST_ELEMENTS_RO(fragments, node, tlvs)) {
|
for (ALL_LIST_ELEMENTS_RO(fragments, node, tlvs)) {
|
||||||
if (node != listhead(fragments)) {
|
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,
|
frag = lsp_next_frag(LSP_FRAGMENT(frag->hdr.lsp_id) + 1,
|
||||||
lsp, area, level);
|
lsp, area, level);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user