mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 10:09:25 +00:00
fpm: reset/walk data structures on connection
Don't attempt to walk data structures while not connected so we can save some CPU usage when FPM server is offline. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
1f9193c1f0
commit
f584de526d
@ -536,6 +536,13 @@ static int fpm_write(struct thread *t)
|
||||
|
||||
fnc->connecting = false;
|
||||
|
||||
/*
|
||||
* Starting with LSPs walk all FPM objects, marking them
|
||||
* as unsent and then replaying them.
|
||||
*/
|
||||
thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
|
||||
&fnc->t_lspreset);
|
||||
|
||||
/* Permit receiving messages now. */
|
||||
thread_add_read(fnc->fthread->master, fpm_read, fnc,
|
||||
fnc->socket, &fnc->t_read);
|
||||
@ -658,9 +665,12 @@ static int fpm_connect(struct thread *t)
|
||||
/*
|
||||
* Starting with LSPs walk all FPM objects, marking them
|
||||
* as unsent and then replaying them.
|
||||
*
|
||||
* If we are not connected, then delay the objects reset/send.
|
||||
*/
|
||||
thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
|
||||
&fnc->t_lspreset);
|
||||
if (!fnc->connecting)
|
||||
thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
|
||||
&fnc->t_lspreset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user