Changeset 4625

Show
Ignore:
Timestamp:
11/11/08 14:12:05 (2 months ago)
Author:
tobias
Message:

fixing mediation extension

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/charon/processing/jobs/initiate_mediation_job.c

    r4434 r4625  
    5555 
    5656/** 
     57 * Callback to handle initiation of mediation connection 
     58 */ 
     59static bool initiate_callback(private_initiate_mediation_job_t *this, 
     60            debug_t group, level_t level, ike_sa_t *ike_sa, 
     61            char *format, va_list args) 
     62{ 
     63    if (ike_sa && !this->mediation_sa_id) 
     64    { 
     65        this->mediation_sa_id = ike_sa->get_id(ike_sa); 
     66        this->mediation_sa_id = this->mediation_sa_id->clone(this->mediation_sa_id); 
     67    } 
     68    return TRUE; 
     69} 
     70 
     71/** 
    5772 * Implementation of job_t.execute. 
    5873 */  
     
    97112        mediation_cfg->get_ref(mediation_cfg);  
    98113 
    99         /* this function call blocks until the connection is up or failed 
    100          * we do not check the status, but NEED_MORE would be returned on success 
    101          * because the registered callback returns FALSE then 
    102          * this->mediation_sa_id is set in the callback */ 
    103         charon->controller->initiate(charon->controller, mediation_cfg, NULL, 
    104                                      controller_cb_empty, this); 
    105         if (!this->mediation_sa_id) 
     114        if (charon->controller->initiate(charon->controller, mediation_cfg, 
     115                    NULL, (controller_cb_t)initiate_callback, this) != SUCCESS) 
    106116        { 
    107117            mediation_cfg->destroy(mediation_cfg); 
  • trunk/src/charon/sa/ike_sa.c

    r4618 r4625  
    11701170#ifdef ME 
    11711171    if (this->peer_cfg->is_mediation(this->peer_cfg)) 
    1172     {   /* mediation connection is already established, retrigger state change 
    1173          * to notify bus listeners */ 
    1174         DBG1(DBG_IKE, "mediation connection is already up"); 
    1175         set_state(this, IKE_ESTABLISHED); 
     1172    { 
     1173        if (this->state == IKE_ESTABLISHED) 
     1174        { 
     1175            /* mediation connection is already established, retrigger state change 
     1176             * to notify bus listeners */ 
     1177            DBG1(DBG_IKE, "mediation connection is already up"); 
     1178            set_state(this, IKE_ESTABLISHED); 
     1179        } 
    11761180        DESTROY_IF(child_cfg); 
    11771181    }