diff options
| author | zhou-run <166502045+zhou-run@users.noreply.github.com> | 2024-06-17 18:00:04 +0800 | 
|---|---|---|
| committer | baozhen (RD) <bao.zhen@h3c.com> | 2024-06-19 15:44:51 +0800 | 
| commit | 0db469958c9b7c7b763797da457e84d2f033a2f7 (patch) | |
| tree | 9294b178fd604c5a9e1929a9ef5cea19fb724fff /isisd/isisd.c | |
| parent | 045029e2442dbca3b6e7685438d171fa05c0f968 (diff) | |
isisd: Even after configuring "no hostname dynamic", the topology still displays the hostname.
The command "show isis topology" calls print_sys_hostname() to display the system ID or hostname, but it does not check the area->dynhostname flag.
Signed-off-by: zhou-run <zhou.run@h3c.com>
Diffstat (limited to 'isisd/isisd.c')
| -rw-r--r-- | isisd/isisd.c | 27 | 
1 files changed, 25 insertions, 2 deletions
diff --git a/isisd/isisd.c b/isisd/isisd.c index 982df0839b..1f119dbcc8 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -272,7 +272,7 @@ void isis_area_del_circuit(struct isis_area *area, struct isis_circuit *circuit)  	isis_csm_state_change(ISIS_DISABLE, circuit, area);  } -static void delete_area_addr(void *arg) +void isis_area_address_delete(void *arg)  {  	struct iso_address *addr = (struct iso_address *)arg; @@ -330,7 +330,7 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)  	area->circuit_list = list_new();  	area->adjacency_list = list_new();  	area->area_addrs = list_new(); -	area->area_addrs->del = delete_area_addr; +	area->area_addrs->del = isis_area_address_delete;  	if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))  		event_add_timer(master, lsp_tick, area, 1, &area->t_tick); @@ -471,6 +471,29 @@ struct isis_area *isis_area_lookup(const char *area_tag, vrf_id_t vrf_id)  	return NULL;  } +struct isis_area *isis_area_lookup_by_sysid(const uint8_t *sysid) +{ +	struct isis_area *area; +	struct listnode *node; +	struct isis *isis; +	struct iso_address *addr = NULL; + +	isis = isis_lookup_by_sysid(sysid); +	if (isis == NULL) +		return NULL; + +	for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) { +		if (listcount(area->area_addrs) > 0) { +			addr = listgetdata(listhead(area->area_addrs)); +			if (!memcmp(addr->area_addr + addr->addr_len, sysid, +				    ISIS_SYS_ID_LEN)) +				return area; +			} +		} + +	return NULL; +} +  int isis_area_get(struct vty *vty, const char *area_tag)  {  	struct isis_area *area;  | 
