summaryrefslogtreecommitdiffstats
path: root/isisd/isis_circuit.c
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2020-07-01 19:37:16 +0200
committerEmanuele Di Pascale <emanuele@voltanet.io>2020-07-01 21:48:38 +0200
commit7145d5bb3af5ee67f3f5edefb0a44741d079fc85 (patch)
treec9e3abd6faa02900b16431b2e9498b230fe92bca /isisd/isis_circuit.c
parentMerge pull request #6657 from donaldsharp/pbr_disable_on_4.9 (diff)
downloadfrr-7145d5bb3af5ee67f3f5edefb0a44741d079fc85.tar.xz
frr-7145d5bb3af5ee67f3f5edefb0a44741d079fc85.zip
isisd: log adj change when circuit goes down
if we shutdown an interface isisd will delete the adjacencies on the corresponding circuit, but it will not log the change. Fix it to make sure that each change is logged. Also specify the level of the adjacency in the log message, while we are at it. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'isisd/isis_circuit.c')
-rw-r--r--isisd/isis_circuit.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index 9804841d6..03d7b3d07 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -720,6 +720,43 @@ void isis_circuit_down(struct isis_circuit *circuit)
isis_notif_if_state_change(circuit, true);
#endif /* ifndef FABRICD */
+ /* log adjacency changes if configured to do so */
+ if (circuit->area && circuit->area->log_adj_changes) {
+ struct isis_adjacency *adj = NULL;
+ if (circuit->circ_type == CIRCUIT_T_P2P) {
+ adj = circuit->u.p2p.neighbor;
+ if (adj)
+ isis_log_adj_change(
+ adj, adj->adj_state, ISIS_ADJ_DOWN,
+ "circuit is being brought down");
+ } else if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
+ struct list *adj_list;
+ struct listnode *node;
+ if (circuit->u.bc.adjdb[0]) {
+ adj_list = list_new();
+ isis_adj_build_up_list(circuit->u.bc.adjdb[0],
+ adj_list);
+ for (ALL_LIST_ELEMENTS_RO(adj_list, node, adj))
+ isis_log_adj_change(
+ adj, adj->adj_state,
+ ISIS_ADJ_DOWN,
+ "circuit is being brought down");
+ list_delete(&adj_list);
+ }
+ if (circuit->u.bc.adjdb[1]) {
+ adj_list = list_new();
+ isis_adj_build_up_list(circuit->u.bc.adjdb[1],
+ adj_list);
+ for (ALL_LIST_ELEMENTS_RO(adj_list, node, adj))
+ isis_log_adj_change(
+ adj, adj->adj_state,
+ ISIS_ADJ_DOWN,
+ "circuit is being brought down");
+ list_delete(&adj_list);
+ }
+ }
+ }
+
/* Clear the flags for all the lsps of the circuit. */
isis_circuit_update_all_srmflags(circuit, 0);