]> git.puffer.fish Git - mirror/frr.git/commit
isisd: fix incorrect snmp-id gen/free
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 27 Apr 2021 14:28:44 +0000 (17:28 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 29 Apr 2021 14:05:21 +0000 (17:05 +0300)
commite2b5b7d6d7fac5507f7bfb4dcf9d66f7c79e7fbb
tree626e9f30c10fd4bf10333d670f8bd909b3982abe
parentd8c3daca19add1c3cedea05e9a30fb33f2b4e9ad
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>
isisd/isis_circuit.c
isisd/isis_circuit.h
isisd/isis_snmp.c
isisd/isisd.h