]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: fix issue with lsp queueing logic in lsp_tick
authorChristian Franke <chris@opensourcerouting.org>
Thu, 5 Oct 2017 13:39:28 +0000 (15:39 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Thu, 5 Oct 2017 14:02:33 +0000 (16:02 +0200)
isisd/isis_circuit.c
isisd/isis_circuit.h
isisd/isis_constants.h
isisd/isis_lsp.c
isisd/isis_pdu.c

index 1c1385ab77a4c72640b617a8a59870ed8a9a4a0e..309e366e8e074a52c2a93a714a8faf9894eef098 100644 (file)
@@ -676,7 +676,7 @@ int isis_circuit_up(struct isis_circuit *circuit)
 
        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;
 }
index 29694deb349584ccf6de0ab182566c5520f1472c..ac1e15f6bf6f16035b52621df0933a789855bb54 100644 (file)
@@ -84,7 +84,7 @@ struct isis_circuit {
        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
index b7b5d35c2e6df30671caab0c452ed0a406a30f4c..1046b0014c4fee743c543412f4aee8a75143b9bf 100644 (file)
@@ -73,7 +73,7 @@
 #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
index bee6abfdab9c182b837ec7eedfb6216c2805a8ea..34b51d470b282fb5d8370dba31023142762761c8 100644 (file)
@@ -1805,6 +1805,7 @@ int lsp_tick(struct thread *thread)
        dnode_t *dnode, *dnode_next;
        int level;
        u_int16_t rem_lifetime;
+        time_t now = monotime(NULL);
 
        lsp_list = list_new();
 
@@ -1883,12 +1884,13 @@ int lsp_tick(struct thread *thread)
                                        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
index 2f9e3caf1ccb8f3194d01172dbca57d00c38d18c..1960edeb529878aa1564102e3b7f290f7e0c3c61 100644 (file)
@@ -2056,12 +2056,8 @@ int send_lsp(struct thread *thread)
        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);
        }