]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes a bug in locking code.
authorOndrej Zajicek <santiago@crfreenet.org>
Sat, 21 Feb 2015 11:27:05 +0000 (12:27 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sat, 21 Feb 2015 11:30:14 +0000 (12:30 +0100)
When multiple protocols have a lock for the same IP address, it crashes
under some circumstances.

Thanks to Matthias Schiffer for the bugreport.

nest/locks.c

index c74f2f45d9cd5e185682448c47a0a4c1d853effe..ad2af4938959d7219958562825fa7ea112e96321 100644 (file)
@@ -70,7 +70,7 @@ olock_free(resource *r)
          DBG("olock: -> %p becomes locked\n", n);
          q = SKIP_BACK(struct object_lock, n, n);
          rem_node(n);
-         add_tail_list(&l->waiters, &q->waiters);
+         add_tail_list(&q->waiters, &l->waiters);
          q->state = OLOCK_STATE_EVENT;
          add_head(&olock_list, n);
          ev_schedule(olock_event);