]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes nasty bug in BFD.
authorOndrej Zajicek <santiago@crfreenet.org>
Wed, 2 Apr 2014 17:58:23 +0000 (19:58 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Wed, 2 Apr 2014 17:58:23 +0000 (19:58 +0200)
When a BFD session is removed while being scheduled for notification,
the session stays in notify list and is removed twice, which leads to
a strange crash after a while.

proto/bfd/bfd.c

index 315d132b6555245b648c4fc53bd0b83d1a1e0a91..7bbe8c2142097b72768191bb3c3ca5184ccaac1f 100644 (file)
@@ -477,8 +477,15 @@ bfd_remove_session(struct bfd_proto *p, struct bfd_session *s)
 {
   ip_addr ip = s->addr;
 
+  /* Caller should ensure that request list is empty */
+
   birdloop_enter(p->loop);
 
+  /* Remove session from notify list if scheduled for notification */
+  /* No need for bfd_lock_sessions(), we are already protected by birdloop_enter() */
+  if (NODE_VALID(&s->n))
+    rem_node(&s->n);
+
   bfd_free_iface(s->ifa);
 
   rfree(s->tx_timer);