]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: avoid lsp_sched loop when unstable
authorEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 17 Mar 2021 12:24:19 +0000 (13:24 +0100)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Fri, 19 Mar 2021 09:37:58 +0000 (10:37 +0100)
no point in scheduling an LSP refresh immediately if we know it is
going to be postponed again due to the network still being in its
instability grace period

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
isisd/isis_lsp.c

index 06a5a69e3f1463b93baf22e69d7c55d2013d2266..d610495de683bd24920843521584073e646f058a 100644 (file)
@@ -1561,18 +1561,28 @@ int _lsp_regenerate_schedule(struct isis_area *area, int level,
                        /*
                         * Schedule LSP refresh ASAP
                         */
-                       timeout = 0;
-
                        if (area->bfd_signalled_down) {
                                sched_debug(
                                        "ISIS (%s): Scheduling immediately due to BDF 'down' message.",
                                        area->area_tag);
                                area->bfd_signalled_down = false;
                                area->bfd_force_spf_refresh = true;
+                               timeout = 0;
                        } else {
-                               sched_debug(
-                                       "ISIS (%s): Last generation was more than lsp_gen_interval ago. Scheduling for execution now.",
-                                       area->area_tag);
+                               int64_t time_since_last = monotime_since(
+                                       &area->last_lsp_refresh_event[lvl - 1],
+                                       NULL);
+                               timeout = time_since_last < 100000L
+                                                 ? (100000L - time_since_last)/1000
+                                                 : 0;
+                               if (timeout > 0)
+                                       sched_debug(
+                                               "ISIS (%s): Last generation was more than lsp_gen_interval ago. Scheduling for execution in %ld ms due to the instability timer.",
+                                               area->area_tag, timeout);
+                               else
+                                       sched_debug(
+                                               "ISIS (%s): Last generation was more than lsp_gen_interval ago. Scheduling for execution now.",
+                                               area->area_tag);
                        }
                }