]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: trigger hellos on adjacency state change
authorChristian Franke <chris@opensourcerouting.org>
Wed, 10 Oct 2018 14:00:16 +0000 (16:00 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Tue, 4 Dec 2018 15:13:24 +0000 (16:13 +0100)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/isis_adjacency.c

index 9013c7c19b10e5df649f9b01ee59c32f34a7246c..b0f2947ec6bbac2baa2506fc64701a83cfc2856f 100644 (file)
@@ -215,21 +215,24 @@ void isis_adj_process_threeway(struct isis_adjacency *adj,
                }
        }
 
+       if (adj->threeway_state != next_tw_state) {
+               send_hello_sched(adj->circuit, 0, TRIGGERED_IIH_DELAY);
+       }
+
        adj->threeway_state = next_tw_state;
 }
 
 void isis_adj_state_change(struct isis_adjacency *adj,
                           enum isis_adj_state new_state, const char *reason)
 {
-       int old_state;
-       int level;
-       struct isis_circuit *circuit;
+       enum isis_adj_state old_state = adj->adj_state;
+       struct isis_circuit *circuit = adj->circuit;
        bool del;
 
-       old_state = adj->adj_state;
        adj->adj_state = new_state;
-
-       circuit = adj->circuit;
+       if (new_state != old_state) {
+               send_hello_sched(circuit, adj->level, TRIGGERED_IIH_DELAY);
+       }
 
        if (isis->debugs & DEBUG_ADJ_PACKETS) {
                zlog_debug("ISIS-Adj (%s): Adjacency state change %d->%d: %s",
@@ -257,7 +260,7 @@ void isis_adj_state_change(struct isis_adjacency *adj,
 
        if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
                del = false;
-               for (level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
+               for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
                        if ((adj->level & level) == 0)
                                continue;
                        if (new_state == ISIS_ADJ_UP) {
@@ -298,16 +301,13 @@ void isis_adj_state_change(struct isis_adjacency *adj,
 
        } else if (circuit->circ_type == CIRCUIT_T_P2P) {
                del = false;
-               for (level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
+               for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
                        if ((adj->level & level) == 0)
                                continue;
                        if (new_state == ISIS_ADJ_UP) {
                                circuit->upadjcount[level - 1]++;
                                hook_call(isis_adj_state_change_hook, adj);
 
-                               if (adj->sys_type == ISIS_SYSTYPE_UNKNOWN)
-                                       send_hello(circuit, level);
-
                                /* update counter & timers for debugging
                                 * purposes */
                                adj->last_flap = time(NULL);
@@ -337,8 +337,6 @@ void isis_adj_state_change(struct isis_adjacency *adj,
                if (del)
                        isis_delete_adj(adj);
        }
-
-       return;
 }