fixed mobike/auth_lifetime in conjunction with p2p-natt
[strongswan.git] / src / charon / sa / tasks / ike_auth_lifetime.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;