circuit->lsp_queue = list_new();
circuit->lsp_hash = isis_lsp_hash_new();
- monotime(&circuit->lsp_queue_last_cleared);
+ circuit->lsp_queue_last_push = monotime(NULL);
return ISIS_OK;
}
struct thread *t_send_lsp;
struct list *lsp_queue; /* LSPs to be txed (both levels) */
struct isis_lsp_hash *lsp_hash; /* Hashtable synchronized with lsp_queue */
- struct timeval lsp_queue_last_cleared; /* timestamp used to enforce transmit
+ time_t lsp_queue_last_push; /* timestamp used to enforce transmit
* interval;
* for scalability, use one timestamp per
* circuit, instead of one per lsp per
#define MAX_MIN_LSP_GEN_INTERVAL 120 /* RFC 4444 says 65535 */
#define DEFAULT_MIN_LSP_GEN_INTERVAL 30
-#define MIN_LSP_TRANS_INTERVAL 20000 /* Microseconds */
+#define MIN_LSP_RETRANS_INTERVAL 5 /* Seconds */
#define MIN_CSNP_INTERVAL 1
#define MAX_CSNP_INTERVAL 600
dnode_t *dnode, *dnode_next;
int level;
u_int16_t rem_lifetime;
+ time_t now = monotime(NULL);
lsp_list = list_new();
if (!circuit->lsp_queue)
continue;
- if (monotime_since(
- &circuit->lsp_queue_last_cleared,
- NULL) < MIN_LSP_TRANS_INTERVAL) {
+ if (now - circuit->lsp_queue_last_push
+ < MIN_LSP_RETRANS_INTERVAL) {
continue;
}
+ circuit->lsp_queue_last_push = now;
+
for (ALL_LIST_ELEMENTS_RO(
lsp_list, lspnode, lsp)) {
if (circuit->upadjcount
lsp = isis_circuit_lsp_queue_pop(circuit);
if (!lsp)
return ISIS_OK;
- /* Set the last-cleared time if the queue is empty. */
- /* TODO: Is is possible that new lsps keep being added to the queue
- * that the queue is never empty? */
- if (list_isempty(circuit->lsp_queue)) {
- monotime(&circuit->lsp_queue_last_cleared);
- } else {
+
+ if (!list_isempty(circuit->lsp_queue)) {
isis_circuit_schedule_lsp_send(circuit);
}