diff options
author | Emanuele Di Pascale <emanuele@voltanet.io> | 2020-06-08 18:00:42 +0200 |
---|---|---|
committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2020-06-09 22:56:43 +0200 |
commit | 8cea00652203ea1dbbfedbad887e186b424b4ef0 (patch) | |
tree | eb9db89acf58869cab8bcfc9a3adb48ce473af09 /isisd | |
parent | Merge pull request #6510 from donaldsharp/useful_timings (diff) | |
download | frr-8cea00652203ea1dbbfedbad887e186b424b4ef0.tar.xz frr-8cea00652203ea1dbbfedbad887e186b424b4ef0.zip |
isisd: fix adj up->init transition
there are some paths, e.g. when an established neighbor
sends us hellos with a different IS level, where we go
from adj_state UP to INIT. In such cases we might not
update our SPFs or the circuit state, as the state change
function was only testing for the UP and DOWN cases.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_adjacency.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index acfe3e2e1..94e38435a 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -268,10 +268,11 @@ void isis_adj_state_change(struct isis_adjacency **padj, struct isis_circuit *circuit = adj->circuit; bool del = false; + if (new_state == old_state) + return; + adj->adj_state = new_state; - if (new_state != old_state) { - send_hello_sched(circuit, adj->level, TRIGGERED_IIH_DELAY); - } + 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", @@ -314,7 +315,7 @@ void isis_adj_state_change(struct isis_adjacency **padj, * purposes */ adj->last_flap = time(NULL); adj->flaps++; - } else if (new_state == ISIS_ADJ_DOWN) { + } else if (old_state == ISIS_ADJ_UP) { listnode_delete(circuit->u.bc.adjdb[level - 1], adj); @@ -323,7 +324,8 @@ void isis_adj_state_change(struct isis_adjacency **padj, isis_tx_queue_clean(circuit->tx_queue); hook_call(isis_adj_state_change_hook, adj); - del = true; + if (new_state == ISIS_ADJ_DOWN) + del = true; } if (circuit->u.bc.lan_neighs[level - 1]) { @@ -362,7 +364,7 @@ void isis_adj_state_change(struct isis_adjacency **padj, circuit, 0, &circuit->t_send_csnp[1]); } - } else if (new_state == ISIS_ADJ_DOWN) { + } else if (old_state == ISIS_ADJ_UP) { if (adj->circuit->u.p2p.neighbor == adj) adj->circuit->u.p2p.neighbor = NULL; circuit->upadjcount[level - 1]--; @@ -370,7 +372,8 @@ void isis_adj_state_change(struct isis_adjacency **padj, isis_tx_queue_clean(circuit->tx_queue); hook_call(isis_adj_state_change_hook, adj); - del = true; + if (new_state == ISIS_ADJ_DOWN) + del = true; } } } |