diff options
author | Emanuele Di Pascale <emanuele@voltanet.io> | 2020-09-23 16:37:21 +0200 |
---|---|---|
committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2020-09-25 12:20:34 +0200 |
commit | e4229afd5fdb7bb0921683c877226b41d657b1cf (patch) | |
tree | 13b83e62b339d8442470c1b0b0185dfce9d2f4f7 /isisd/isis_adjacency.c | |
parent | Merge pull request #7169 from donaldsharp/some_code_cleanup (diff) | |
download | frr-e4229afd5fdb7bb0921683c877226b41d657b1cf.tar.xz frr-e4229afd5fdb7bb0921683c877226b41d657b1cf.zip |
isisd: simplify adj_change hook call
There is no need to call isis_adj_state_change_hook once per level
in isis_adj_state_change, we can just do it once at the end.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'isisd/isis_adjacency.c')
-rw-r--r-- | isisd/isis_adjacency.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index f7cdd58f7..f0cf93ac4 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -304,7 +304,6 @@ void isis_adj_state_change(struct isis_adjacency **padj, continue; if (new_state == ISIS_ADJ_UP) { circuit->upadjcount[level - 1]++; - hook_call(isis_adj_state_change_hook, adj); /* update counter & timers for debugging * purposes */ adj->last_flap = time(NULL); @@ -317,7 +316,6 @@ void isis_adj_state_change(struct isis_adjacency **padj, if (circuit->upadjcount[level - 1] == 0) isis_tx_queue_clean(circuit->tx_queue); - hook_call(isis_adj_state_change_hook, adj); if (new_state == ISIS_ADJ_DOWN) del = true; } @@ -342,7 +340,6 @@ void isis_adj_state_change(struct isis_adjacency **padj, continue; if (new_state == ISIS_ADJ_UP) { circuit->upadjcount[level - 1]++; - hook_call(isis_adj_state_change_hook, adj); /* update counter & timers for debugging * purposes */ @@ -365,13 +362,14 @@ void isis_adj_state_change(struct isis_adjacency **padj, if (circuit->upadjcount[level - 1] == 0) isis_tx_queue_clean(circuit->tx_queue); - hook_call(isis_adj_state_change_hook, adj); if (new_state == ISIS_ADJ_DOWN) del = true; } } } + hook_call(isis_adj_state_change_hook, adj); + if (del) { isis_delete_adj(adj); *padj = NULL; |