diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-07-17 15:39:29 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-07-22 11:10:36 +0200 |
commit | ffff7219ef6af21c9497af8db49bfb3c1c9a3036 (patch) | |
tree | 0c2eb284b44c121ca1b49d3d30dc71f9f42bf412 /src/frontends/android/jni/libandroidbridge/backend/android_service.c | |
parent | 5fd9e5fd009995ce0b6fed738efc00d90a0d1f89 (diff) | |
download | strongswan-ffff7219ef6af21c9497af8db49bfb3c1c9a3036.tar.bz2 strongswan-ffff7219ef6af21c9497af8db49bfb3c1c9a3036.tar.xz |
android: For keyingtries > 0 notify the GUI if the limit is reached when reestablishing
The IKE_SA is destroyed anyway, so letting the GUI remain in
"connecting" state would be incorrect.
We still use keyingtries=0 for now, though. And we still abort after the
first failed attempt initially, in case there is a configuration error.
Diffstat (limited to 'src/frontends/android/jni/libandroidbridge/backend/android_service.c')
-rw-r--r-- | src/frontends/android/jni/libandroidbridge/backend/android_service.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/frontends/android/jni/libandroidbridge/backend/android_service.c b/src/frontends/android/jni/libandroidbridge/backend/android_service.c index 5a85d3026..e60c491c1 100644 --- a/src/frontends/android/jni/libandroidbridge/backend/android_service.c +++ b/src/frontends/android/jni/libandroidbridge/backend/android_service.c @@ -502,6 +502,23 @@ METHOD(listener_t, alert, bool, (callback_job_cb_t)terminate, id, free, (callback_job_cancel_t)return_false, JOB_PRIO_HIGH)); } + else + { + peer_cfg_t *peer_cfg; + u_int32_t tries, try; + + /* when reestablishing and if keyingtries is not %forever + * the IKE_SA is destroyed after the set number of tries, + * so notify the GUI */ + peer_cfg = ike_sa->get_peer_cfg(ike_sa); + tries = peer_cfg->get_keyingtries(peer_cfg); + try = va_arg(args, u_int32_t); + if (tries != 0 && try == tries-1) + { + charonservice->update_status(charonservice, + CHARONSERVICE_UNREACHABLE_ERROR); + } + } this->lock->unlock(this->lock); break; default: |