]> git.proxmox.com Git - mirror_frr.git/commit
lib: fix log target removal when singlethreaded
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 5 Mar 2022 18:39:53 +0000 (19:39 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 7 Mar 2022 16:23:12 +0000 (17:23 +0100)
commitd03440cab78605dcc21427127afdf78860d9916b
treeaf7ac444e2b20e7fc7b692663994e038fb6fb69b
parent404e53da28b3cf26667653f8d8986e59bccf844a
lib: fix log target removal when singlethreaded

While running singlethreaded, the RCU code is "dormant" and rcu_free is
an immediate operation.  This results in the log target loop accessing
free'd memory if a log target removes itself while a message is printed
(which is likely to happen on e.g. error conditions.)

Just use frr_each_safe to avoid this issue.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/zlog.c