From 4d0e9e2a9f049ff074aed953c0afc6a3be4da73e Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 22 May 2024 11:30:24 +0200 Subject: [PATCH 1/3] isisd: fix show isis route algorithm crash Fix crash with "show isis route algorithm X" command. Fixes: 88e368b4dc ("isisd: make optional algorithm id in 'show isis route'") Signed-off-by: Louis Scalbert --- isisd/isis_spf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 418e0af16b..d63235ce61 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -3123,8 +3123,7 @@ DEFUN(show_isis_route, show_isis_route_cmd, #ifndef FABRICD if (argv_find(argv, argc, "algorithm", &idx)) { if (argv_find(argv, argc, "(128-255)", &idx)) - algorithm = (uint8_t)strtoul(argv[idx + 1]->arg, NULL, - 10); + algorithm = (uint8_t)strtoul(argv[idx]->arg, NULL, 10); else all_algorithm = true; } From c2058bb0a0a657d61bb16917ee9b8f90d0dda503 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 22 May 2024 13:30:05 +0200 Subject: [PATCH 2/3] isisd: fix show isis topology display Fix "Area X:" display for fabricd Fixes: f185005b2f ("isisd: fix the display topology command") Signed-off-by: Louis Scalbert --- isisd/isis_spf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index d63235ce61..c19fb3244e 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -2357,10 +2357,12 @@ static void show_isis_topology_common(struct vty *vty, int levels, fa_data = (struct isis_flex_algo_data *)fa->data; } else fa_data = NULL; +#endif /* ifndef FABRICD */ vty_out(vty, "Area %s:", area->area_tag ? area->area_tag : "null"); +#ifndef FABRICD if (algo != SR_ALGORITHM_SPF) vty_out(vty, " Algorithm %hhu\n", algo); else From 47640d5e321eeb102d43d4a9b5b7b992ee37bf1b Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 22 May 2024 13:34:01 +0200 Subject: [PATCH 3/3] isisd: fix show isis segment-routing node algorithm Fix an issue where "show isis segment-routing node algorithm" displays "IS-IS X SR-Nodes:" for absent flex-algorithms. > IS-IS L2 SR-Nodes: > > IS-IS L2 SR-Nodes: > [...] Signed-off-by: Louis Scalbert --- isisd/isis_sr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index af22f56f8b..f783038006 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -1020,8 +1020,6 @@ static void show_node(struct vty *vty, struct isis_area *area, int level, struct ttable *tt; char buf[128]; - vty_out(vty, " IS-IS %s SR-Nodes:\n\n", circuit_t2string(level)); - /* Prepare table. */ tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]); ttable_add_row(tt, "System ID|SRGB|SRLB|Algorithm|MSD"); @@ -1062,6 +1060,8 @@ static void show_node(struct vty *vty, struct isis_area *area, int level, if (tt->nrows > 1) { char *table; + vty_out(vty, " IS-IS %s SR-Nodes:\n\n", circuit_t2string(level)); + table = ttable_dump(tt, "\n"); vty_out(vty, "%s\n", table); XFREE(MTYPE_TMP, table);