summaryrefslogtreecommitdiff
path: root/nest/neighbor.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-01-12 14:06:49 +0100
committerMaria Matejka <mq@ucw.cz>2022-02-03 10:30:33 +0100
commitb6c9263543060141d79e205e1b3408099ad1afc4 (patch)
treebada190f4106905ebfd638a1777c8fb255c0e9f9 /nest/neighbor.c
parentb5155d5cea6af783619144ca49648ad743cf4e38 (diff)
Interfaces and neighbor notifications do properly enter protocol loops
Diffstat (limited to 'nest/neighbor.c')
-rw-r--r--nest/neighbor.c10
1 files changed, 8 insertions, 2 deletions
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