fixing checkout of IKE SAs with only the initiator SPI
authorTobias Brunner <tobias@strongswan.org>
Wed, 10 Dec 2008 15:58:39 +0000 (15:58 -0000)
committerTobias Brunner <tobias@strongswan.org>
Wed, 10 Dec 2008 15:58:39 +0000 (15:58 -0000)
src/charon/sa/ike_sa_manager.c

index ef2a91d..66a1550 100644 (file)
@@ -174,7 +174,8 @@ static bool entry_match_by_id(entry_t *entry, ike_sa_id_t *id)
        {
                return TRUE;
        }       
        {
                return TRUE;
        }       
-       if (entry->ike_sa_id->get_responder_spi(entry->ike_sa_id) == 0 &&
+       if ((id->get_responder_spi(id) == 0 ||
+                entry->ike_sa_id->get_responder_spi(entry->ike_sa_id) == 0) &&
                id->is_initiator(id) == entry->ike_sa_id->is_initiator(entry->ike_sa_id) &&
                id->get_initiator_spi(id) == entry->ike_sa_id->get_initiator_spi(entry->ike_sa_id))
        {
                id->is_initiator(id) == entry->ike_sa_id->is_initiator(entry->ike_sa_id) &&
                id->get_initiator_spi(id) == entry->ike_sa_id->get_initiator_spi(entry->ike_sa_id))
        {