android: Ignore if peer is unreachable when reestablishing an SA
authorTobias Brunner <tobias@strongswan.org>
Tue, 16 Oct 2012 11:41:02 +0000 (13:41 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 18 Oct 2012 10:25:59 +0000 (12:25 +0200)
src/frontends/android/jni/libandroidbridge/backend/android_service.c

index d451a3d..b00567f 100644 (file)
@@ -414,8 +414,13 @@ METHOD(listener_t, alert, bool,
                                                                                         CHARONSERVICE_PEER_AUTH_ERROR);
                                break;
                        case ALERT_PEER_INIT_UNREACHABLE:
-                               charonservice->update_status(charonservice,
-                                                                                        CHARONSERVICE_UNREACHABLE_ERROR);
+                               this->lock->read_lock(this->lock);
+                               if (this->tunfd < 0)
+                               {       /* only handle this if we are not reestablishing the SA */
+                                       charonservice->update_status(charonservice,
+                                                                                       CHARONSERVICE_UNREACHABLE_ERROR);
+                               }
+                               this->lock->unlock(this->lock);
                                break;
                        default:
                                break;