From c5b8ce0620a9b9558569224ee28b5dfc95e71836 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 22 Apr 2021 15:04:15 -0400 Subject: [PATCH] isisd: Remove warnings and add some data to debugs for isis_csm.c When running isis and not running isis on all interfaces results in a bunch of warn messages to the log about circuit state changes. These warn messages also didn't bother to inform the end user what interface was causing the fun. Since the end operator cannot do anything with these warn messages and nor should they in the vast array of normal operations modify the code to use event debugging and turn the warns to debugs. Additionally add some information to clue the operator in on to what actual interface we are talking about. Signed-off-by: Donald Sharp --- isisd/isis_csm.c | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/isisd/isis_csm.c b/isisd/isis_csm.c index 0ac9aa0950..ebb68ba3f0 100644 --- a/isisd/isis_csm.c +++ b/isisd/isis_csm.c @@ -67,6 +67,7 @@ struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, enum isis_circuit_state old_state; struct isis *isis = NULL; struct isis_area *area = NULL; + struct interface *ifp; old_state = circuit ? circuit->state : C_STATE_NA; if (IS_DEBUG_EVENTS) @@ -86,23 +87,29 @@ struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, circuit->state = C_STATE_CONF; break; case IF_UP_FROM_Z: - isis = isis_lookup_by_vrfid(((struct interface *)arg)->vrf_id); + ifp = arg; + isis = isis_lookup_by_vrfid(ifp->vrf_id); if (isis == NULL) { - zlog_warn( - " %s : ISIS routing instance not found", - __func__); + if (IS_DEBUG_EVENTS) + zlog_debug( + " %s : ISIS routing instance not found when attempting to apply against interface %s", + __func__, ifp->name); break; } circuit = isis_circuit_new(isis); - isis_circuit_if_add(circuit, (struct interface *)arg); + isis_circuit_if_add(circuit, ifp); listnode_add(isis->init_circ_list, circuit); circuit->state = C_STATE_INIT; break; case ISIS_DISABLE: - zlog_warn("circuit already disabled"); + if (IS_DEBUG_EVENTS) + zlog_debug( + "circuit disable event passed for a non existent circuit"); break; case IF_DOWN_FROM_Z: - zlog_warn("circuit already disconnected"); + if (IS_DEBUG_EVENTS) + zlog_debug( + "circuit disconnect event passed for a non existent circuit"); break; } break; @@ -124,11 +131,14 @@ struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, circuit); break; case IF_UP_FROM_Z: - assert(circuit); - zlog_warn("circuit already connected"); + if (IS_DEBUG_EVENTS) + zlog_debug("circuit %s already connected", + circuit->interface->name); break; case ISIS_DISABLE: - zlog_warn("circuit already disabled"); + if (IS_DEBUG_EVENTS) + zlog_debug("circuit %s already disabled", + circuit->interface->name); break; case IF_DOWN_FROM_Z: isis_circuit_if_del(circuit, (struct interface *)arg); @@ -143,7 +153,9 @@ struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, assert(circuit); switch (event) { case ISIS_ENABLE: - zlog_warn("circuit already enabled"); + if (IS_DEBUG_EVENTS) + zlog_debug("circuit %p is already enabled", + circuit); break; case IF_UP_FROM_Z: isis_circuit_if_add(circuit, (struct interface *)arg); @@ -166,7 +178,9 @@ struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, circuit = NULL; break; case IF_DOWN_FROM_Z: - zlog_warn("circuit already disconnected"); + if (IS_DEBUG_EVENTS) + zlog_debug("circuit %p already disconnected", + circuit); break; } break; @@ -174,10 +188,14 @@ struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event, assert(circuit); switch (event) { case ISIS_ENABLE: - zlog_warn("circuit already configured"); + if (IS_DEBUG_EVENTS) + zlog_debug("circuit %s already configured", + circuit->interface->name); break; case IF_UP_FROM_Z: - zlog_warn("circuit already connected"); + if (IS_DEBUG_EVENTS) + zlog_debug("circuit %s already connected", + circuit->interface->name); break; case ISIS_DISABLE: isis = circuit->isis; -- 2.39.5