diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-09-02 17:29:02 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-09-02 17:30:47 +0200 |
commit | a20e98749aca92ebbdb13f248c31c0dc7c7bc5a6 (patch) | |
tree | ae1f9d4155159648a56c604729a2a2e82030e59f /src | |
parent | 484a06bce795e1d1508c965f969138715dcf02cb (diff) | |
download | strongswan-a20e98749aca92ebbdb13f248c31c0dc7c7bc5a6.tar.bz2 strongswan-a20e98749aca92ebbdb13f248c31c0dc7c7bc5a6.tar.xz |
Simplified the search for ME_CONNECTID notifies.
Diffstat (limited to 'src')
-rw-r--r-- | src/charon/sa/tasks/ike_init.c | 47 |
1 files changed, 5 insertions, 42 deletions
diff --git a/src/charon/sa/tasks/ike_init.c b/src/charon/sa/tasks/ike_init.c index ce94cd172..a64ec3d53 100644 --- a/src/charon/sa/tasks/ike_init.c +++ b/src/charon/sa/tasks/ike_init.c @@ -314,50 +314,13 @@ static status_t process_r(private_ike_init_t *this, message_t *message) #ifdef ME { - chunk_t connect_id = chunk_empty; - enumerator_t *enumerator; - payload_t *payload; - - /* check for a ME_CONNECTID notify */ - enumerator = message->create_payload_enumerator(message); - while (enumerator->enumerate(enumerator, &payload)) - { - if (payload->get_type(payload) == NOTIFY) - { - notify_payload_t *notify = (notify_payload_t*)payload; - notify_type_t type = notify->get_notify_type(notify); - - switch (type) - { - case ME_CONNECTID: - { - chunk_free(&connect_id); - connect_id = chunk_clone(notify->get_notification_data(notify)); - DBG2(DBG_IKE, "received ME_CONNECTID %#B", &connect_id); - break; - } - default: - { - if (type < 16383) - { - DBG1(DBG_IKE, "received %N notify error", - notify_type_names, type); - break; - } - DBG2(DBG_IKE, "received %N notify", - notify_type_names, type); - break; - } - } - } - } - enumerator->destroy(enumerator); - - if (connect_id.ptr) + notify_payload_t *notify = message->get_notify(message, ME_CONNECTID); + if (notify) { + chunk_t connect_id = notify->get_notification_data(notify); + DBG2(DBG_IKE, "received ME_CONNECTID %#B", &connect_id); charon->connect_manager->stop_checks(charon->connect_manager, - connect_id); - chunk_free(&connect_id); + connect_id); } } #endif /* ME */ |