ike-sa-manager: Signal waiting threads after check out/in for uniqueness check
authorTobias Brunner <tobias@strongswan.org>
Fri, 6 Nov 2015 08:18:44 +0000 (09:18 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 9 Nov 2015 14:18:37 +0000 (15:18 +0100)
Fixes 758b1caa0e75 ("ikev1: Prevent deadlock when checking for duplicate IKEv1 SAs")

src/libcharon/sa/ike_sa_manager.c

index 9ebdae7..4adf22c 100644 (file)
@@ -1646,6 +1646,9 @@ METHOD(ike_sa_manager_t, checkin, void,
                                 * need for a lookup via get_entry_by... */
                                lock_single_segment(this, segment);
                                entry->checked_out = FALSE;
+                               /* We already signaled waiting threads above, we have to do that
+                                * again after checking the SA out and back in again. */
+                               entry->condvar->signal(entry->condvar);
                        }
                }