Changeset 4640
- Timestamp:
- 11/12/08 17:07:17 (2 months ago)
- Files:
-
- trunk/src/charon/sa/ike_sa.c (modified) (9 diffs)
- trunk/src/charon/sa/ike_sa.h (modified) (2 diffs)
- trunk/src/charon/sa/tasks/ike_me.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/charon/sa/ike_sa.c
r4632 r4640 246 246 */ 247 247 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;253 248 254 249 /** … … 480 475 ike_cfg->get_ref(ike_cfg); 481 476 this->ike_cfg = ike_cfg; 482 }483 484 /**485 * Implementation of ike_sa_t.is_ike_initiator486 */487 static bool is_ike_initiator(private_ike_sa_t *this)488 {489 return this->ike_initiator;490 477 } 491 478 … … 1141 1128 } 1142 1129 1143 this->ike_initiator = TRUE;1130 set_condition(this, COND_ORIGINAL_INITIATOR, TRUE); 1144 1131 1145 1132 task = (task_t*)ike_init_create(&this->public, TRUE, NULL); … … 1726 1713 * If the peer does not support RFC4478, there is no way to keep the 1727 1714 * IKE_SA up. */ 1728 if (! this->ike_initiator)1715 if (!has_condition(this, COND_ORIGINAL_INITIATOR)) 1729 1716 { 1730 1717 DBG1(DBG_IKE, "initiator did not reauthenticate as requested"); … … 1804 1791 1805 1792 /* check if we are able to reestablish this IKE_SA */ 1806 if (! this->ike_initiator&&1793 if (!has_condition(this, COND_ORIGINAL_INITIATOR) && 1807 1794 (this->other_virtual_ip != NULL || 1808 1795 has_condition(this, COND_EAP_AUTHENTICATED) … … 2031 2018 this->my_id = other->my_id->clone(other->my_id); 2032 2019 this->other_id = other->other_id->clone(other->other_id); 2033 this->ike_initiator = other->ike_initiator;2034 2020 2035 2021 /* apply virtual assigned IPs... */ … … 2052 2038 } 2053 2039 2054 /* inherit NAT-Tconditions */2040 /* inherit all conditions */ 2055 2041 this->conditions = other->conditions; 2056 2042 if (this->conditions & COND_NAT_HERE) … … 2345 2331 this->public.set_pending_updates = (void(*)(ike_sa_t*, u_int32_t updates))set_pending_updates; 2346 2332 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;2348 2333 this->public.create_additional_address_iterator = (iterator_t*(*)(ike_sa_t*))create_additional_address_iterator; 2349 2334 this->public.add_additional_address = (void(*)(ike_sa_t*, host_t *host))add_additional_address; … … 2416 2401 this->pending_updates = 0; 2417 2402 this->keyingtry = 0; 2418 this->ike_initiator = FALSE;2419 2403 this->local_host = NULL; 2420 2404 this->remote_host = NULL; trunk/src/charon/sa/ike_sa.h
r4612 r4640 109 109 */ 110 110 COND_NAT_FAKE = (1<<3), 111 111 112 112 /** 113 113 * peer has ben authenticated using EAP 114 114 */ 115 115 COND_EAP_AUTHENTICATED = (1<<4), 116 116 117 117 /** 118 118 * received a certificate request from the peer 119 119 */ 120 120 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), 121 126 }; 122 127 … … 484 489 void (*set_pending_updates)(ike_sa_t *this, u_int32_t updates); 485 490 486 /**487 * Check if we are the original initiator of this IKE_SA (rekeying does not488 * change this flag).489 */490 bool (*is_ike_initiator)(ike_sa_t *this);491 492 493 491 #ifdef ME 494 492 /** trunk/src/charon/sa/tasks/ike_me.c
r4434 r4640 786 786 this->public.task.destroy = (void(*)(task_t*))destroy; 787 787 788 if (ike_sa-> is_ike_initiator(ike_sa))788 if (ike_sa->has_condition(ike_sa, COND_ORIGINAL_INITIATOR)) 789 789 { 790 790 if (initiator)
