fixed mobike/auth_lifetime in conjunction with p2p-natt
authorMartin Willi <martin@strongswan.org>
Tue, 4 Dec 2007 10:05:36 +0000 (10:05 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 4 Dec 2007 10:05:36 +0000 (10:05 -0000)
src/charon/sa/tasks/ike_auth_lifetime.c
src/charon/sa/tasks/ike_mobike.c

index 8820afd..9d37ec6 100644 (file)
@@ -125,7 +125,7 @@ static status_t process_r(private_ike_auth_lifetime_t *this, message_t *message)
 static status_t build_r(private_ike_auth_lifetime_t *this, message_t *message)
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, SECURITY_ASSOCIATION))
+               this->ike_sa->get_state(this->ike_sa) == IKE_ESTABLISHED)
        {
                add_auth_lifetime(this, message);
                return SUCCESS;
@@ -139,7 +139,7 @@ static status_t build_r(private_ike_auth_lifetime_t *this, message_t *message)
 static status_t process_i(private_ike_auth_lifetime_t *this, message_t *message)
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, SECURITY_ASSOCIATION))
+               this->ike_sa->get_state(this->ike_sa) == IKE_ESTABLISHED)
        {
                process_payloads(this, message);
                return SUCCESS;
index d1fc8c6..a53c243 100644 (file)
@@ -287,7 +287,7 @@ static void transmit(private_ike_mobike_t *this, packet_t *packet)
 static status_t build_i(private_ike_mobike_t *this, message_t *message)
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, SECURITY_ASSOCIATION))
+               message->get_payload(message, ID_INITIATOR))
        {
                message->add_notify(message, FALSE, MOBIKE_SUPPORTED, chunk_empty);
                build_address_list(this, message);
@@ -317,7 +317,7 @@ static status_t build_i(private_ike_mobike_t *this, message_t *message)
 static status_t process_r(private_ike_mobike_t *this, message_t *message)
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, SECURITY_ASSOCIATION))
+               message->get_payload(message, ID_INITIATOR))
        {
                process_payloads(this, message);
        }
@@ -348,7 +348,7 @@ static status_t process_r(private_ike_mobike_t *this, message_t *message)
 static status_t build_r(private_ike_mobike_t *this, message_t *message)
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, SECURITY_ASSOCIATION))
+               this->ike_sa->get_state(this->ike_sa) == IKE_ESTABLISHED)
        {
                if (this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE))
                {
@@ -378,7 +378,7 @@ static status_t build_r(private_ike_mobike_t *this, message_t *message)
 static status_t process_i(private_ike_mobike_t *this, message_t *message)
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
-               message->get_payload(message, SECURITY_ASSOCIATION))
+               this->ike_sa->get_state(this->ike_sa) == IKE_ESTABLISHED)
        {
                process_payloads(this, message);
                return SUCCESS;