summaryrefslogtreecommitdiff
path: root/isisd/fabricd.c
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2018-11-23 04:26:19 +0100
committerRodny Molina <rmolina@linkedin.com>2018-12-07 19:45:14 +0000
commite923107c7b25c26b07e47153e2f1042748390f96 (patch)
tree6b22a8654d2383468b7219ecac317514a413dab4 /isisd/fabricd.c
parenta6b60da99af0be34919d94564ad3549ed1757804 (diff)
fabricd: make triggered csnp delay configurable
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'isisd/fabricd.c')
-rw-r--r--isisd/fabricd.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c
index 537dc99661..e1d838429d 100644
--- a/isisd/fabricd.c
+++ b/isisd/fabricd.c
@@ -65,6 +65,9 @@ struct fabricd {
uint8_t tier_pending;
struct thread *tier_calculation_timer;
struct thread *tier_set_timer;
+
+ int csnp_delay;
+ bool always_send_csnp;
};
/* Code related to maintaining the neighbor lists */
@@ -211,6 +214,8 @@ struct fabricd *fabricd_new(struct isis_area *area)
"Fabricd Neighbors");
rv->tier = rv->tier_config = ISIS_TIER_UNDEFINED;
+
+ rv->csnp_delay = FABRICD_DEFAULT_CSNP_DELAY;
return rv;
};
@@ -506,6 +511,12 @@ int fabricd_write_settings(struct isis_area *area, struct vty *vty)
written++;
}
+ if (f->csnp_delay != FABRICD_DEFAULT_CSNP_DELAY
+ || f->always_send_csnp) {
+ vty_out(vty, " triggered-csnp-delay %d%s\n", f->csnp_delay,
+ f->always_send_csnp ? " always" : "");
+ }
+
return written;
}
@@ -707,13 +718,16 @@ void fabricd_lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit)
}
}
-void fabricd_trigger_csnp(struct isis_area *area)
+void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped)
{
struct fabricd *f = area->fabricd;
if (!f)
return;
+ if (!circuit_scoped && !f->always_send_csnp)
+ return;
+
struct listnode *node;
struct isis_circuit *circuit;
@@ -723,7 +737,7 @@ void fabricd_trigger_csnp(struct isis_area *area)
thread_cancel(circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
thread_add_timer_msec(master, send_l2_csnp, circuit,
- isis_jitter(500, CSNP_JITTER),
+ isis_jitter(f->csnp_delay, CSNP_JITTER),
&circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
}
}
@@ -773,3 +787,15 @@ void fabricd_update_lsp_no_flood(struct isis_lsp *lsp,
fabricd_lsp_reset_flooding_info(lsp, circuit);
lsp->flooding_circuit_scoped = true;
}
+
+void fabricd_configure_triggered_csnp(struct isis_area *area, int delay,
+ bool always_send_csnp)
+{
+ struct fabricd *f = area->fabricd;
+
+ if (!f)
+ return;
+
+ f->csnp_delay = delay;
+ f->always_send_csnp = always_send_csnp;
+}