Changeset 4640

Show
Ignore:
Timestamp:
11/12/08 17:07:17 (2 months ago)
Author:
martin
Message:

moved ike_initiator flag to IKE_SAs condition bitfield

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/charon/sa/ike_sa.c

    r4632 r4640  
    246246     */ 
    247247    u_int32_t keyingtry; 
    248      
    249     /** 
    250      * are we the initiator of this IKE_SA (rekeying does not affect this flag) 
    251      */ 
    252     bool ike_initiator; 
    253248 
    254249    /** 
     
    480475    ike_cfg->get_ref(ike_cfg); 
    481476    this->ike_cfg = ike_cfg; 
    482 } 
    483  
    484 /** 
    485  * Implementation of ike_sa_t.is_ike_initiator 
    486  */ 
    487 static bool is_ike_initiator(private_ike_sa_t *this) 
    488 { 
    489     return this->ike_initiator; 
    490477} 
    491478 
     
    11411128        } 
    11421129         
    1143         this->ike_initiator = TRUE
     1130        set_condition(this, COND_ORIGINAL_INITIATOR, TRUE)
    11441131         
    11451132        task = (task_t*)ike_init_create(&this->public, TRUE, NULL); 
     
    17261713     * If the peer does not support RFC4478, there is no way to keep the 
    17271714     * IKE_SA up. */ 
    1728     if (!this->ike_initiator
     1715    if (!has_condition(this, COND_ORIGINAL_INITIATOR)
    17291716    { 
    17301717        DBG1(DBG_IKE, "initiator did not reauthenticate as requested"); 
     
    18041791     
    18051792    /* check if we are able to reestablish this IKE_SA */ 
    1806     if (!this->ike_initiator && 
     1793    if (!has_condition(this, COND_ORIGINAL_INITIATOR) && 
    18071794        (this->other_virtual_ip != NULL || 
    18081795         has_condition(this, COND_EAP_AUTHENTICATED) 
     
    20312018    this->my_id = other->my_id->clone(other->my_id); 
    20322019    this->other_id = other->other_id->clone(other->other_id); 
    2033     this->ike_initiator = other->ike_initiator; 
    20342020     
    20352021    /* apply virtual assigned IPs... */ 
     
    20522038    } 
    20532039 
    2054     /* inherit NAT-T conditions */ 
     2040    /* inherit all conditions */ 
    20552041    this->conditions = other->conditions; 
    20562042    if (this->conditions & COND_NAT_HERE) 
     
    23452331    this->public.set_pending_updates = (void(*)(ike_sa_t*, u_int32_t updates))set_pending_updates; 
    23462332    this->public.get_pending_updates = (u_int32_t(*)(ike_sa_t*))get_pending_updates; 
    2347     this->public.is_ike_initiator = (bool (*)(ike_sa_t*))is_ike_initiator; 
    23482333    this->public.create_additional_address_iterator = (iterator_t*(*)(ike_sa_t*))create_additional_address_iterator; 
    23492334    this->public.add_additional_address = (void(*)(ike_sa_t*, host_t *host))add_additional_address; 
     
    24162401    this->pending_updates = 0; 
    24172402    this->keyingtry = 0; 
    2418     this->ike_initiator = FALSE; 
    24192403    this->local_host = NULL; 
    24202404    this->remote_host = NULL; 
  • trunk/src/charon/sa/ike_sa.h

    r4612 r4640  
    109109     */ 
    110110    COND_NAT_FAKE = (1<<3), 
    111  
     111     
    112112    /** 
    113113     * peer has ben authenticated using EAP 
    114114     */ 
    115115    COND_EAP_AUTHENTICATED = (1<<4), 
    116  
     116     
    117117    /** 
    118118     * received a certificate request from the peer 
    119119     */ 
    120120    COND_CERTREQ_SEEN = (1<<5), 
     121     
     122    /** 
     123     * Local peer is the "original" IKE initiator. Unaffected from rekeying. 
     124     */ 
     125    COND_ORIGINAL_INITIATOR = (1<<6), 
    121126}; 
    122127 
     
    484489    void (*set_pending_updates)(ike_sa_t *this, u_int32_t updates); 
    485490     
    486     /** 
    487      * Check if we are the original initiator of this IKE_SA (rekeying does not 
    488      * change this flag). 
    489      */ 
    490     bool (*is_ike_initiator)(ike_sa_t *this); 
    491      
    492  
    493491#ifdef ME 
    494492    /** 
  • trunk/src/charon/sa/tasks/ike_me.c

    r4434 r4640  
    786786    this->public.task.destroy = (void(*)(task_t*))destroy; 
    787787     
    788     if (ike_sa->is_ike_initiator(ike_sa)) 
     788    if (ike_sa->has_condition(ike_sa, COND_ORIGINAL_INITIATOR)) 
    789789    { 
    790790        if (initiator)