From: Martin Willi Date: Tue, 11 Sep 2012 10:20:37 +0000 (+0200) Subject: Send FAILED_CP_REQUIRED if a configuration payload was expected, but not received X-Git-Tag: 5.0.1~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7294f7a58f5c7bf9273e324299c8b311cfecaae;p=thirdparty%2Fstrongswan.git Send FAILED_CP_REQUIRED if a configuration payload was expected, but not received --- diff --git a/src/libcharon/sa/ikev2/tasks/ike_config.c b/src/libcharon/sa/ikev2/tasks/ike_config.c index d624fd1706..c44f0452c9 100644 --- a/src/libcharon/sa/ikev2/tasks/ike_config.c +++ b/src/libcharon/sa/ikev2/tasks/ike_config.c @@ -386,6 +386,15 @@ METHOD(task_t, build_r, status_t, pools->destroy(pools); return SUCCESS; } + if (pools->get_count(pools) && !this->vips->get_count(this->vips)) + { + DBG1(DBG_IKE, "expected a virtual IP request, sending %N", + notify_type_names, FAILED_CP_REQUIRED); + message->add_notify(message, FALSE, FAILED_CP_REQUIRED, chunk_empty); + vips->destroy_offset(vips, offsetof(host_t, destroy)); + pools->destroy(pools); + return SUCCESS; + } /* query registered providers for additional attributes to include */ enumerator = hydra->attributes->create_responder_enumerator(