child-sa: Reclaim old state if SA updating is not supported
authorMartin Willi <martin@revosec.ch>
Fri, 9 May 2014 06:39:55 +0000 (08:39 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 9 May 2014 06:49:08 +0000 (08:49 +0200)
If the state stays at UPDATING, the fallback using IKEv1 rekeying fails as
the task manager refuses to rekey a CHILD_SA in non-INSTALLED state.

src/libcharon/sa/child_sa.c

index 720a585..847cfc7 100644 (file)
@@ -916,6 +916,7 @@ METHOD(child_sa_t, update, status_t,
                                                        this->other_addr, this->my_addr, other, me,
                                                        this->encap, encap, this->mark_in) == NOT_SUPPORTED)
                        {
+                               set_state(this, old);
                                return NOT_SUPPORTED;
                        }
                }
@@ -929,6 +930,7 @@ METHOD(child_sa_t, update, status_t,
                                                        this->my_addr, this->other_addr, me, other,
                                                        this->encap, encap, this->mark_out) == NOT_SUPPORTED)
                        {
+                               set_state(this, old);
                                return NOT_SUPPORTED;
                        }
                }