summaryrefslogtreecommitdiffstats
path: root/isisd/isis_misc.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-06-11 17:27:46 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2021-06-11 17:30:47 +0200
commit240f48b36b59bc53599e8df6579513e0d7744680 (patch)
treec12e2c5b6dec823c01b4f37fde490fbc59863e10 /isisd/isis_misc.c
parentMerge pull request #8831 from sworleys/Fix-No-Ospf-Func (diff)
downloadfrr-240f48b36b59bc53599e8df6579513e0d7744680.tar.xz
frr-240f48b36b59bc53599e8df6579513e0d7744680.zip
isisd: per-instance dynamic hostname cache
Currently, the dynamic hostname cache is global. It is incorrect because neighbors in different VRFs may have the same system ID and different hostnames. This also fixes a memory leak - when the instance is deleted, the cache must be cleaned up and the cleanup thread must be cancelled. Fixes #8832. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'isisd/isis_misc.c')
-rw-r--r--isisd/isis_misc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c
index d3d081d37..d49ad8485 100644
--- a/isisd/isis_misc.c
+++ b/isisd/isis_misc.c
@@ -458,6 +458,7 @@ const char *print_sys_hostname(const uint8_t *sysid)
{
struct isis_dynhn *dyn;
struct isis *isis = NULL;
+ struct listnode *node;
if (!sysid)
return "nullsysid";
@@ -467,9 +468,11 @@ const char *print_sys_hostname(const uint8_t *sysid)
if (isis && !CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
return cmd_hostname_get();
- dyn = dynhn_find_by_id(sysid);
- if (dyn)
- return dyn->hostname;
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
+ dyn = dynhn_find_by_id(isis, sysid);
+ if (dyn)
+ return dyn->hostname;
+ }
return sysid_print(sysid);
}