summaryrefslogtreecommitdiff
path: root/isisd/isis_circuit.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-04-27 17:28:44 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-04-29 17:05:21 +0300
commite2b5b7d6d7fac5507f7bfb4dcf9d66f7c79e7fbb (patch)
tree626e9f30c10fd4bf10333d670f8bd909b3982abe /isisd/isis_circuit.h
parentd8c3daca19add1c3cedea05e9a30fb33f2b4e9ad (diff)
isisd: fix incorrect snmp-id gen/free
Necessary structures for snmp-id generation are currently stored in `struct isis`. When we generate the new circuit ID, we always use the instance from the default VRF. When we free the circuit ID, we use the instance from the circuit VRF. This causes the following problems: 1. If there is no instance in the default VRF, this code doesn't work. 2. When circuit in non-default VRF is deleted, the ID is not actually freed. This is fixed by using global structures instead. The code itself is moved to isis_snmp.c and linked to the main code using hooks. We should not call SNMP-related code when the SNMP module is not loaded at all. More than that, we don't allow to activate the circuit if we failed to generate the SNMP ID. Even if SNMP support is completely disabled! This check is removed. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'isisd/isis_circuit.h')
-rw-r--r--isisd/isis_circuit.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h
index d4c7baea1a..72722d8217 100644
--- a/isisd/isis_circuit.h
+++ b/isisd/isis_circuit.h
@@ -238,4 +238,7 @@ DECLARE_HOOK(isis_circuit_config_write,
DECLARE_HOOK(isis_circuit_add_addr_hook, (struct isis_circuit *circuit),
(circuit));
+DECLARE_HOOK(isis_circuit_new_hook, (struct isis_circuit *circuit), (circuit));
+DECLARE_HOOK(isis_circuit_del_hook, (struct isis_circuit *circuit), (circuit));
+
#endif /* _ZEBRA_ISIS_CIRCUIT_H */