mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 06:14:35 +00:00
fabricd: Update neighbor list on adjacency state change
We should update our neighbors list immediately when an adjacency changes state, not when we run SPF. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
This commit is contained in:
parent
e923107c7b
commit
2cd971af00
@ -161,9 +161,15 @@ static struct neighbor_entry *neighbor_entry_lookup_hash(struct hash *hash,
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void neighbor_lists_update(struct fabricd *f)
|
||||
static int fabricd_handle_adj_state_change(struct isis_adjacency *arg)
|
||||
{
|
||||
neighbor_lists_clear(f);
|
||||
struct fabricd *f = arg->circuit->area->fabricd;
|
||||
|
||||
if (!f)
|
||||
return 0;
|
||||
|
||||
while (!skiplist_empty(f->neighbors))
|
||||
skiplist_delete_first(f->neighbors);
|
||||
|
||||
struct listnode *node;
|
||||
struct isis_circuit *circuit;
|
||||
@ -182,6 +188,14 @@ static void neighbor_lists_update(struct fabricd *f)
|
||||
skiplist_insert(f->neighbors, n, n);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void neighbors_neighbors_update(struct fabricd *f)
|
||||
{
|
||||
hash_clean(f->neighbors_neighbors, neighbor_entry_del_void);
|
||||
|
||||
struct listnode *node;
|
||||
struct isis_vertex *v;
|
||||
|
||||
for (ALL_QUEUE_ELEMENTS_RO(&f->spftree->paths, node, v)) {
|
||||
@ -463,7 +477,7 @@ void fabricd_run_spf(struct isis_area *area)
|
||||
return;
|
||||
|
||||
isis_run_hopcount_spf(area, isis->sysid, f->spftree);
|
||||
neighbor_lists_update(f);
|
||||
neighbors_neighbors_update(f);
|
||||
fabricd_bump_tier_calculation_timer(f);
|
||||
}
|
||||
|
||||
@ -799,3 +813,9 @@ void fabricd_configure_triggered_csnp(struct isis_area *area, int delay,
|
||||
f->csnp_delay = delay;
|
||||
f->always_send_csnp = always_send_csnp;
|
||||
}
|
||||
|
||||
void fabricd_init(void)
|
||||
{
|
||||
hook_register(isis_adj_state_change_hook,
|
||||
fabricd_handle_adj_state_change);
|
||||
}
|
||||
|
@ -52,5 +52,5 @@ void fabricd_update_lsp_no_flood(struct isis_lsp *lsp,
|
||||
struct isis_circuit *circuit);
|
||||
void fabricd_configure_triggered_csnp(struct isis_area *area, int delay,
|
||||
bool always_send_csnp);
|
||||
|
||||
void fabricd_init(void);
|
||||
#endif
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "isisd/isis_bfd.h"
|
||||
#include "isisd/isis_lsp.h"
|
||||
#include "isisd/isis_mt.h"
|
||||
#include "isisd/fabricd.h"
|
||||
|
||||
/* Default configuration file name */
|
||||
#define ISISD_DEFAULT_CONFIG "isisd.conf"
|
||||
@ -228,6 +229,7 @@ int main(int argc, char **argv, char **envp)
|
||||
|
||||
isis_zebra_init(master);
|
||||
isis_bfd_init();
|
||||
fabricd_init();
|
||||
|
||||
frr_config_fork();
|
||||
frr_run(master);
|
||||
|
Loading…
Reference in New Issue
Block a user