From b6c9263543060141d79e205e1b3408099ad1afc4 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 12 Jan 2022 14:06:49 +0100 Subject: Interfaces and neighbor notifications do properly enter protocol loops --- nest/neighbor.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'nest/neighbor.c') diff --git a/nest/neighbor.c b/nest/neighbor.c index cb2d1b2b..e10413bd 100644 --- a/nest/neighbor.c +++ b/nest/neighbor.c @@ -210,6 +210,8 @@ if_intersect(struct iface *ia, struct iface *ib) neighbor * neigh_find(struct proto *p, ip_addr a, struct iface *iface, uint flags) { + ASSERT_DIE(birdloop_inside(&main_birdloop)); + neighbor *n; int class, scope = -1; uint h = neigh_hash(p, a, iface); @@ -308,8 +310,12 @@ neigh_dump_all(void) static inline void neigh_notify(neighbor *n) { - if (n->proto->neigh_notify && (n->proto->proto_state != PS_STOP)) - n->proto->neigh_notify(n); + if (!n->proto->neigh_notify) + return; + + PROTO_LOCKED_FROM_MAIN(n->proto) + if (n->proto->proto_state != PS_STOP) + n->proto->neigh_notify(n); } static void -- cgit v1.2.3